10 lines
418 B
Markdown
10 lines
418 B
Markdown
# @wrnexus/cache
|
|
|
|
Bounded in-memory/tag caching and HTTP response caching for WRNexusJS. Supports request deduplication, tag invalidation, ETags, fresh/stale states, and optional detached stale revalidation.
|
|
|
|
```ts
|
|
import { TagCache, responseCache } from "@wrnexus/cache";
|
|
const cache = new TagCache({ ttlMs: 60_000, staleWhileRevalidateMs: 300_000 });
|
|
export default responseCache({ cache, tags: ["products"] });
|
|
```
|