CacheStore
CacheStore
provides a ready-to-use solution for cache management.
According to Salesforce Platform Cache Best Practices, too many requests for small cached items are inefficient. A recommended way is to bundle these items into a large item to be cached. The problem is that we have a size limit for the single cached item. That means that we cannot put too huge an item into the cache.
CacheStore is hence created to offer an elegant way to solve this. Inside CacheStore, we manage a list of bundles, each of them is a Map
To check the details, please see the implementation of
CacheStore
.
Here is how we use it.
CacheStore store = new CacheStore('Your Partition');
store.OrgCache.put('key', 'value');
String value = (String)store.get('key');