Questions tagged [platform-cache]

The Force.com Platform Cache layer provides faster performance and better reliability when caching Salesforce session and org data. Specify what to cache and for how long without using custom objects and settings or overloading a Visualforce view state. Platform Cache improves performance by distributing cache space so that some applications or operations don’t steal capacity from others.

Filter by
Sorted by
Tagged with
1 vote
0 answers
11 views

Including cache partition in managed package

I'm trying to include a cache partition in a managed package with "Provider Free" space allocated. In my packaging org I created a cache partition with a "Provider Free" value of &...
user avatar
  • 145
0 votes
2 answers
106 views

Platform Cache Breaks sfdx retrieve?

I have added a platform cache partition to my managed package source code: I have just added Platform Cache to my package.xml file: <types> <members>*</members> <name>...
user avatar
  • 295
1 vote
0 answers
24 views

Trial cache partition not released after having uninstalled a package

Each time I uninstall a package from my scratch org, the trial cache capacity is not released. So the only possibility I have is to create a new scratch org, request a new trial cache and then install ...
user avatar
  • 75
1 vote
1 answer
105 views

Can we set the Platform Cache using API call

I have a requirement where I need to maintain/use few values through out the session and I am thinking to use Platform Cache. Since, we are getting these values from a 3rd party I am wondering if we ...
user avatar
  • 2,659
1 vote
1 answer
99 views

Is it possible to pre-warm a session or org cache partition when using the CacheBuilder interface?

I'm working on reducing data storage space and increasing the amount of automation for an integration with an external system. The relevant part of that integration for this question is a sync of ...
user avatar
  • 48.2k
0 votes
1 answer
48 views

How to pass cookie/storage details from other website to the salesforce [closed]

I am trying to pass some details from a non-salesforce website to salesforce website while creating the case. Use Case : I am in a product website and if I have any question then I will click the help ...
user avatar
  • 2,659
0 votes
0 answers
2k views

Calling LWC from Aura component, but LWC doesn't render when using standard button to call aura for the 2nd time

I'm fairly new to Aura and LWC altogether. I'm overriding a standard new button with an Aura Component and calling an LWC component from there. LWC component calls another LWC component from it. I'm ...
user avatar
0 votes
0 answers
23 views

Provider Free Capacity [duplicate]

I've updated the cachePartition metadata of a 2GP package, which has previously passed security review. <platformCachePartitionTypes> ... <allocatedPartnerCapacity>2</...
user avatar
0 votes
0 answers
122 views

How to access Platform Cache using REST API

I have a requirement to retrieve available resource and consumed resources for Platform Cache outside my salesforce org. I was wondering if we can use REST API to retrieve this result ? Given a try by ...
user avatar
2 votes
0 answers
58 views

Is it possible to make cache session expiry time based on put instead of get

In Apex, when we put information into cache.session, there is a method to set the expiry time based on seconds. However, that expiry time seems to be re-calculated every time we put or get into/from ...
user avatar
  • 12.7k
1 vote
1 answer
447 views

Platform Cache - error-like debug log message

I have a requirement where I need to make a callout to an external webservice. However, to make the callout, I need to get a OpenId Auth Token from a corporate webservice first. So, I am trying to use ...
user avatar
0 votes
1 answer
46 views

Best Approach to Store and Retrieve session information

I am not very old player in Salesforce Integration but I have basic knowledge of Salesforce Integration. For my learning I have created some methods which gets session information from other ...
user avatar
1 vote
0 answers
150 views

LWC - Component not refreshing after NavigationMixin save [duplicate]

I have a button that points to a NavigationMixin that opens a popup for creating a new child record for the parent record they are currently looking at: navigateToNew() { this[...
user avatar
  • 648
0 votes
0 answers
85 views

Alternative for using multiple callouts from Salesforce to external System

We retrieve a list of flight passengers from an external system via a callout. The endpoint sends us a passenger list along with arrival and departure airport codes. Our external system has another ...
user avatar
  • 183
2 votes
1 answer
233 views

Platform Cache and default partition

I am implementing the platform cache for first time. My query in below snippent is taking lot of time so I want to put the query result in cache/ if(Cache.Org.contains('cvList')){ for (...
user avatar
  • 1,549
0 votes
0 answers
554 views

Incorrect Lightning record page shown for users

We have a profile called as "Consumer Banker", and Consumer Banker profile has the "Consumer Individual Record Page" assigned for the App + Record Type + Profile combination. The ...
user avatar
  • 3
2 votes
1 answer
94 views

Is there a limit to how many concurrent or total retrievals you can make with Platform Cache?

The features documentation mentions that the Platform Cache API is what allows you to store and retrieve data that's tied to a Salesforce session or shared across your org. Seeing "API" ...
user avatar
0 votes
1 answer
162 views

Use Platform Cache to cache ~50 records from a custom object

We have a custom object that realistically should have been Custom Metadata / Custom Settings as it stores background metadata that controls how pages within our Community load. It has been very ...
user avatar
  • 1,226
4 votes
0 answers
135 views

Org Cache Behaving differently in Sandbox

I'm using org cache to store the results of a call to the google maps geocode api. Just noticed, the caching doesn't seem to work in a Sandbox. You can see how I'm storing/accessing here: public ...
user avatar
8 votes
2 answers
612 views

How can I detect that a packaged Platform Cache Partition has no capacity allocated?

I have a platform cache partition that is packaged as part of a managed package. Once it is installed in a subscribers org it defaults to zero capacity. Using getPartition() and OrgCacheException I ...
user avatar
4 votes
0 answers
841 views

Detecting change on Record in Lightning Web Component withing Communities

I am looking for a solution to a basic scenario: A User in a Community submits an Opportunity, this Opportunity is enriched with data synchronously upon insert and asynchronously through ...
user avatar
  • 255
3 votes
1 answer
824 views

What is the "default time to live" (TTL) for Platform Cache?

The Platform Cache Partition Class allows a time to live to be specified when a value is put into the cache: put(key, value, ttlSecs) Stores the specified key/value pair as a cached entry in the ...
user avatar
  • 130k
1 vote
0 answers
34 views

Writing master-detail records to platform cache

Platform Cache is very good feature for my development work. Today I came across a scenario which it doesn't work the way I intended. Perhaps someone can clarify that for me. I have retrieved a ...
user avatar
  • 89
2 votes
1 answer
233 views

How to get time left on OrgPartition from Platform Cache?

Is it possible to get the time left from Platform Cache for a particular partition? You initiate by: Cache.OrgPartition orgPart = Cache.Org.getPartition('local.myStore'); You put the value by (...
user avatar
  • 1,838
17 votes
1 answer
379 views

Does data referenced from the Platform Cache consume heap space?

Reading Platform Cache Limits, it appears that an individual request can obtain up to 1 MB of data from the Platform Cache: Maximum local cache size for a partition, per-request 1,000 KB ... ...
user avatar
  • 130k
1 vote
0 answers
119 views

Is it possible to cache into local org partition from a managed package?

Is it possible to cache into local org partition from a managed package? In other words can we do this Cache.Org.put('local.ABCPartition.XYZ', 'Test Object'); from the managed package, where in ...
user avatar
  • 21
0 votes
1 answer
280 views

Does "Request Trial Capacity" for Platform Cache work in scratch orgs?

I clicked the "Request Trial Capacity" button 20 minutes ago in a scratch org and Get Started with Platform Cache says: Click Request Trial Capacity and wait for the email notifying you that your ...
user avatar
  • 130k
5 votes
1 answer
257 views

Clean way for code to work with or without Platform Cache?

Just started trying out Platform Cache, and the code needs to work with or without cache partitions set up. As the first error I got was: SessionCacheException:[]: A default partition was not ...
user avatar
  • 130k
4 votes
2 answers
479 views

Platform Cache for ISVs

I have used Platform Cache as a customer a while ago but never heard any story about ISVs using it. So, I'm wondering: is there any ISV out there using it and if there is any, how?
user avatar
4 votes
1 answer
535 views

Salesforce Platform Cache not working in Sales Console

I am using the Platform Cache to store the Id of the customer the salesperson is speaking with on the phone, such that different Lightning Components automatically load the customer's details as the ...
user avatar
  • 8,262
5 votes
2 answers
703 views

Maintain state in Visualforce Page without using View State

I would know if there is some way to maintain state across different transactions without using View State. For example, if in my Custom Controller, for every action method, I need 100 Account's ...
user avatar
  • 685
5 votes
1 answer
469 views

Does the Platform Session Cache interpret multiple Site Guest User sessions separately?

I'm considering using a Platform Session Cache for User sessions on my force.com site. My question is: Does the Platform Session Cache interpret the "Force.com Site Guest User" as a single session, ...
user avatar
6 votes
1 answer
218 views

How to debug Lightning components with Platform Cache?

I am researching how to make use of platform cache in a lightning component to reduce the number of API calls that it will need to make. The problem is that when I push code for a Lightning component, ...
user avatar
  • 149
4 votes
1 answer
798 views

How to specify namespace and partition for Org Cache when creating managed package?

I'd like to make an ISV App / Managed package that uses the Platform Org Cache. The clearest directions on how to do this are described in this trailhead. However, when writing my code, I am unclear ...
user avatar
  • 239
4 votes
1 answer
4k views

SessionCacheException: A default partition was not found. To cache without partition reference, designate a partition as default

I have a simple class for storing values in the cache, similar to this: public class PersonSessionCache { private static final String PERSON_KEY = 'Person'; public static Id getPersonId(){ ...
user avatar
  • 8,262
3 votes
2 answers
632 views

Cache.Session.contains() always returns False on next script execution even after adding Key with .put()

I am attempting to store values in Cache via an Apex script. I use the Cache.Session.put() method and if I subsequently call .contains() on the next line of the code then the Key shows properly as ...
user avatar
  • 180
1 vote
1 answer
876 views

How to assign Cache time to Live in CacheBuilder interface?

I was experimenting with Platform Cache and stumbled upon CacheBuilder interface which looks robust for our use cache. The only problem is how can I set time to live in this interface? By default it ...
user avatar
1 vote
1 answer
269 views

Platform Cache.Session working only with debug mode

Case Scenario: I need to throw a warning to the user before changing the dates of the standard opportunity. Hence I used Cache.Session to store a variable that checks if the warning has been issued or ...
user avatar
  • 445
0 votes
1 answer
207 views

Cache value not being saved in Org from Async call

I have a batch call that calls a queuaeble that calls a future call which utilizes a visualforce page 'getContentAsPdf' function. Also in this queuable call I set a custom class value to a local ...
user avatar
1 vote
2 answers
141 views

compiler Error : Invalid type: Cache.OrgPartition

I am trying to use Platform cache via Apex Code. 1. Created a new platform cache partition in my org - 10MB assigned to Org Cache. Then created a simple apex class via dev console to access the ...
user avatar
3 votes
1 answer
139 views

How does the Platform Cache reconcile the local cache being smaller than the partition size?

I'm reading through Platform Cache Internals and Platform Cache Limits with respect to the local cache and the overall partition size. It appears that the local cache (the application server's in-...
user avatar
7 votes
1 answer
2k views

Testing Platform Cache usage

When writing Apex test cases for code that utilizes the platform cache what are the important scenarios I need to cover? Additionally, how would I address those is the test methods? For instance, ...
user avatar
3 votes
0 answers
288 views

Example how Lightning components share data via custom Platform Cache

The title already contains basically everything. Using Google I didn't find a single code example on how to use a custom Platform Cache to save and retrieve data from Lightning components. This is ...
user avatar
2 votes
1 answer
267 views

Deploying PlatformCachePartition Metadata - Tests Fail

I noticed a strange behaviour when deploying PlatformCachePartition metadata which also includes test methods in the same package. Below is an example of the PlatformCachePartition metadata: <?xml ...
user avatar
4 votes
0 answers
146 views

How to tell if Platform Cache is available in package?

If I include a Cache Partition in my managed package but don't activate it in the subscriber org (i.e. subscriber has not purchased a license), how do I check if I should be hitting the cache or not? ...
user avatar
  • 3,766
3 votes
1 answer
480 views

Platform Cache System Error (Random)

A few of the users in the system have hit an interesting error after implementing some functionality around the platform cache. I received the emails as the owner of the files, but I was not able to ...
user avatar
6 votes
1 answer
2k views

Platform cache is cleared randomly?

While I doubt the speculation that I put in the title is correct, from time to time my default cache partition (10MB trial) gets emptied within less than an hour. There are about 20 keys in there, ...
user avatar
  • 3,766
2 votes
1 answer
2k views

Cache.Session return null value

I have create small function to store and retrieve the value inside static using session cache. but i am unable to get the data which i have stored in session cache. I am not getting any error on ...
user avatar
  • 2,444
1 vote
0 answers
69 views

Accessing partitions in Platform cache

I have created a couple of partitions in the platform cache of my Org.One of them is default. As per the documentation to access the default partition mentioning the name of the partition is enough ...
user avatar
  • 109
2 votes
2 answers
88 views

Why does the cache seem to know my member variable's value before I save it?

I'm playing around with session/org caches, and I came across something interesting. It seems that if I create a class which can save itself to the cache, then change a member variable on an instance ...
user avatar
  • 387