@jsango/cache
v1.3.0
Published
Cache abstraction, drivers, stampede defense, and serialization for jsango
Readme
@jsango/cache
Universal caching abstraction with stampede protection (remember/getOrSet), namespaces, and in-memory LRU/TTL driver.
Part of the jsango backend framework for TypeScript.
Installation
pnpm add @jsango/cacheUsage
import { CacheManager, MemoryCacheDriver } from '@jsango/cache';
const manager = new CacheManager({
default: new MemoryCacheDriver({ defaultTtl: 300 }),
});
const store = manager.store();
const user = await store.remember('user:42', 60, () => fetchUserFromDb(42));Documentation
For full architecture documentation and guides, visit the jsango documentation.
License
MIT © jsango contributors
