Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Lifecycle of Storable Actions

This image describes the sequence of callback execution for storable actions.

An action might have its callback invoked more than once:

  • First with the cached response, if it’s in storage.
  • Second with updated data from the server, if the stored response has exceeded the time to refresh entries.

Note

Storable Action Lifecycle

Cache Miss

If the action is not a cache hit as it doesn’t match a storage entry:

  1. The action is sent to the server-side controller.
  2. If the response is SUCCESS, the response is added to storage.
  3. The callback in the client-side controller is executed.

Cache Hit

If the action is a cache hit as it matches a storage entry:

  1. The callback in the client-side controller is executed with the cached action response.
  2. If the response has been cached for longer than the refresh time, the storage entry is refreshed.

    When an application enables storable actions, a refresh time is configured. The refresh time is the duration in seconds before an entry is refreshed in storage. The refresh time is automatically configured in Lightning Experience and the Salesforce mobile app.

  3. The action is sent to the server-side controller.
  4. If the response is SUCCESS, the response is added to storage.
  5. If the refreshed response is different from the cached response, the callback in the client-side controller is executed for a second time.