Cache-Manage
a uniform and sample js cache manage
Install
yarn add cache-manage-js
Usage
default use localStorage
strategy to save cache.
let cacheItem = CACHE_ITEM_KEY_NAMEcacheItemcacheItem // { name: 100 }cacheItemcacheItemclear
More Strategy
uniform manage your cache, support four cache strategy:
- localStorage (web api) - default
- sessionStorage (web api)
- MemoryStorage
- CookieStorage (extend js-cookie)
// union manage cache for different cache strategy in a single filelet cacheItem = CACHE_ITEM_KEY_NAME localStoragelet cacheItem = CACHE_ITEM_KEY_NAME sessionStoragelet cacheItem = CACHE_ITEM_KEY_NAMElet cacheItem = CACHE_ITEM_KEY_NAME expires: 7