Newer Version Available
Platform Cache Considerations
There are a few considerations for using Platform Cache features.
- Cache is not persisted. There is no guarantee against data loss.
- Data in the cache is not encrypted.
- The cache doesn’t support concurrent operations. Multiple, simultaneous user requests (for example, from different browser windows) can lead to stale or overwritten data in the cache.
- Cache misses can happen. We recommend constructing your code to consider a case where previously cached items aren’t found.
- The session cache isn’t supported in Anonymous Apex blocks. For example, if you execute Anonymous Apex in the Developer Console, you get an error.
- Cache operations made using the put and remove methods in the Cache Namespace aren’t supported in constructors of Visualforce controllers.
- Partitions are bound by the limits within Salesforce.
- The session cache can store values for a maximum of eight hours and the org cache can store values for a maximum of 48 hours.