Local Storage
- 14 Oct 2024
- 1 Minute to read
- Print
Local Storage
- Updated on 14 Oct 2024
- 1 Minute to read
- Print
Article summary
Did you find this summary helpful?
Thank you for your feedback
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?