Local Storage
  • 14 Oct 2024
  • 1 Minute to read

Local Storage


Article summary

When a template needs to store information cross-invocation, share to other templates running in the same layout or even other Players in the same sync-group, there are several options:

  • LocalStorage/SessionStorage: The most common option but the downside is that only strings can be stored which can cause issues when JSON-serializing Date-objects for example. The available size can also be a limitation and is browser/installation-specific.
  • IndexedDB: For large data-sets or Blobs which need persistence cross-Player reboots as well as fast retrieval, IndexedDB is ideal (API). This can be complex to implement.
  • Persistent Player Storage: The Player exposes object-storage through the controller methods get-/setPersistentChannelItem. These do not survive a restart but can be ideal for Blob-urls for image-data for example.
  • Attributes: Very light-weight and practical for sharing information cross-layers/templates/invocations and even across layers in the same sync-group. Should not be used for large data-sets and when the data-property is expected to be a string.

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.