cachemap
v0.3.0
Published
An isomorphic cache that can use Redis, LocalStorage, IndexedDB or an in-memory Map.
Downloads
35
Maintainers
Readme
cachemap
An isomorphic cache that can use Redis, LocalStorage, IndexedDB or an in-memory Map.
Summary
- Use Redis or an in-memory Map on the server.
- Use LocalStorage, IndexedDB or an in-memory Map on the client.
- Export/import entries and metadata from one Cachemap to another.
- Store data alongside cache-control directives, etag and uuid (tag).
- Cache headers used to derive whether data is fresh or stale.
- Sort stored data based on metadata values.
- Build-in reaper to cull stale data at specified intervals.
- Set approximate maximum memory size for data.
- Use on main thread or as web worker in browser.
Installation
yarn add cachemap
Compilation
The WEB_ENV
environment variable must be set to 'true'
when you compile your browser bundle in order to exclude
Redis from the build.
Documentation
Additional documentation can be found on the Cachemap github pages.
Web worker interface
You can run Cachemap in a web worker by using WorkerCachemap
as the Cachemap interface in your bundle on the main
thread and { worker-cachemap.worker: ./node_modules/cachemap/lib/browser/worker.js }
as the entry point for your
bundle on the worker thread.
Changelog
Check out the features, fixes and more that go into each major, minor and patch version.
License
Cachemap is MIT Licensed.