Newer Version Available
Enable Storable Actions in an Application
Storable actions are automatically configured in Lightning Experience
and the Salesforce mobile app. To use storable actions in a standalone app
(.app resource), you must configure client-side storage for cached action
responses.
To configure client-side storage for your standalone app, use <auraStorage:init> in the auraPreInitBlock attribute of your application’s template. For example:
1<aura:component isTemplate="true" extends="aura:template">
2 <aura:set attribute="auraPreInitBlock">
3 <auraStorage:init
4 name="actions"
5 persistent="false"
6 secure="true"
7 maxSize="1024"
8 defaultExpiration="900"
9 defaultAutoRefreshInterval="30" />
10 </aura:set>
11</aura:component>- name
- The storage name must be actions. Storable actions are the only currently supported type of storage.
- persistent
- Set to true to preserve cached data between user sessions in the browser.
- secure
- Set to true to encrypt cached data.
- maxsize
- The maximum size in KB of the storage.
- defaultExpiration
- The duration in seconds that an entry is retained in storage.
- defaultAutoRefreshInterval
- The duration in seconds before an entry is refreshed in storage.
Storable actions use the Storage Service. The Storage Service supports multiple implementations of storage and selects an adapter at runtime based on browser support and specified characteristics of persistence and security.