💾 Cache Storage Types

Learn how to use different storage types in Toolkitify Cache.

Overview

Toolkitify Cache allows you to store your data in different types of storage depending on your needs:

  • Memory: Fast, temporary storage that only lives while the page is open.
  • LocalStorage: Persistent storage that survives page reloads.
  • SessionStorage: Storage that lasts until the browser tab is closed.
  • Cookies (Not recommended): Storage that can persist across sessions and be sent to the server.

You can switch between these storage types when creating a cache instance using the storage option.

Cache Storage Types Example

Notes

  • Memory storage is fastest but temporary.
  • LocalStorage persists even after page reloads.
  • SessionStorage lasts for the current tab session only.
  • Cookies can persist across sessions and optionally be sent to the server.
  • You can mix different storage types for different needs in the same application.