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
0
votes
0answers
8 views

Deploy cache partition to org without Platform Cache enabled

I wanted to deploy PlatformCachePartition Metadata to an org without having to enable or buy PlatformCache from Salesforce. The org would not use the PlatformCache just contain the pushed Metadata. Is ...
15
votes
1answer
135 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 ... ...
1
vote
0answers
41 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 ...
0
votes
1answer
37 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 ...
3
votes
1answer
57 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 ...
4
votes
2answers
119 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?
4
votes
1answer
137 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 ...
5
votes
2answers
193 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 ...
4
votes
1answer
96 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, ...
6
votes
1answer
145 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, ...
3
votes
0answers
155 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 ...
3
votes
1answer
911 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(){ ...
3
votes
2answers
215 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 ...
0
votes
2answers
289 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 ...
1
vote
1answer
124 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 ...
0
votes
1answer
71 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 ...
1
vote
2answers
57 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 ...
3
votes
1answer
62 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-...
6
votes
1answer
686 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, ...
3
votes
0answers
218 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 ...
2
votes
1answer
67 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 ...
2
votes
0answers
99 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? ...
3
votes
1answer
260 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 ...
4
votes
1answer
549 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, ...
1
vote
1answer
1k 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 ...
1
vote
0answers
46 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 ...
2
votes
2answers
74 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 ...
4
votes
0answers
92 views

Platform cache increasing visualforce execution time

I have decided to use platform cache to retain the result of an expensive callout and processing. Doing so eliminated the callout time and shaved 500ms off of the apex time. Unfortunately my gains ...
1
vote
0answers
260 views

BUG: Unable to clear Platform Cache, Missing Capacity Visuals

I'm not sure why this happens or how to fix it... usually it just fixes its self within moments or hours (never really consistent). But some how the partition visuals just disappear. Unfortunately ...
10
votes
1answer
824 views

Visualforce Component PageReference Method: Platform Cache PUT() Not Allowed?

Right now I have a "Refresh" button on my page that collects some data and sends it to this method: public static Boolean cacheData(String index, MyObject data) { try {reportPartition.put(hash(...
4
votes
1answer
2k views

Why Org cache is not working?

I have been trying to use the Org cache but for some reason cached item is getting removed in the subsequent requests. Below is the code which i wrote inside the controller class if (!Cache.Org....
4
votes
1answer
2k views

Calculate the data size of a given object

I am evaluating the possibility of using the new Platform Cache to store reporting data for each of our franchise records. I could possibly use a custom object instead but for every data point I want ...
7
votes
1answer
1k views

Can the Platform-cache store data with any data type?

I know there are limitations to platform cache though, within the limitation(capacity) is it allowed to store any type of data (Collections, Integer, DateTime, sObject etc...) in the cache? What if ...
13
votes
1answer
1k views

Org Cache VS Custom Settings?

Can anyone provide a good example scenario for using "Org level platform cache" versus custom settings? I can understand when you would use session cache but I am still trying to come up with an ...