Newer Version Available
Storable Actions
Most server requests are read-only and idempotent, which means that a request can be repeated or retried as often as necessary without causing data changes. The responses to idempotent actions can be cached and quickly reused for subsequent identical actions. For storable actions, the key for determining an identical action is a combination of:
- Apex controller name
- Method name
- Method parameter values
Marking an Action as Storable
To mark a server-side action as storable, call setStorable() on the action in JavaScript code, as follows.
1action.setStorable();The setStorable function takes an optional argument, which is a configuration map of key-value pairs representing the storage options and values to set. You can only set the following property:
- ignoreExisting
- Set 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.
To set the storage options for the action response, pass this configuration map into setStorable(configObj).