Leading Through Change with Data
COVID-19 Data Hub
COVID-19 Global Daily Tracker
Global Economy Data Track
Government Data Track
Healthcare Data Track
Leading Through Change
Leading Through Change Blog
< Back to List
Apex method to expose the total capacity allocated to a Platform Cache partition
Development (Apex, LWC & VF)
Currently a Platform Cache that is deployed as part of a managed package may or may not have any cache capacity allocated to it.There currently isn't a way to tell in Apex if a Platform Cache has any capacity allocated to it. As such, resources (CPU/callouts/SOQL queries) will be expended trying populate and use a cache that won't retain anything.The Spring '21 release now includes 3 MB of free Platform Cache for AppExchange-certificed packages. This helps mitigate the problem in many cases if you can spread that 3 MB across all your caches.It does still leave a gap where it might not be possible to allocate any capacity to a paritcular cache. E.g. the cache might not be applicable to all subscribers, so it doesn't make sense to always allocate to it.If there was a method on the Partition class that indicated the storage allocated to it we could easily check in Apex how viable the cache is at runtime.More details are in How can I detect that a packaged Platform Cache Partition has no capacity allocated?
- 5 months ago
The Landmark © One Market St.,
San Francisco, CA 94105
If you can't find what you're looking for,
contact Salesforce Customer Support.
Powered by Community Cloud.
Learn More >
Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.
Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.
Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.
Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.