Newer Version Available

This content describes an older version of this product. View Latest

setStorable()

Marks an Apex action as storable to have its response stored in the framework’s client-side cache . Enhance your component’s performance by marking actions as storable (cacheable) to quickly show cached data from client-side storage without waiting for a server trip. If the cached data is stale, the framework retrieves the latest data from the server. Caching is especially beneficial for users on high latency, slow, or unreliable connections such as 3G networks.

Client-side storage is automatically configured in Lightning Experience and the Salesforce mobile app. A component shouldn’t assume a cache duration because it may change as we optimize the platform.

Note

Signature

setStorable (Object config)

Parameters

config
Type: Object
An optional configuration map of key-value pairs representing the storage options and values to set. You can only set the ignoreExisting property. Set ignoreExisting to true to bypass the cache. The default value is false.
This property is useful when you know that any cached data is invalid, such as after a record modification. This property should be used rarely because it explicitly defeats caching.