HTTP cache example
Sources:
examples/http-cache/README.md|examples/http-cache/index.ts
Purpose
Section titled “Purpose”Minimal embedded usage showing remember, stale reads, background refresh, invalidation, and metrics.
Start here if
Section titled “Start here if”- teams who want to start with CacheCore as a library inside another backend
What it demonstrates
Section titled “What it demonstrates”- read-through caching with remember
- stale-while-revalidate behavior
- tag invalidation and metrics inspection
Workspace details
Section titled “Workspace details”- Example path:
examples/http-cache - Run command:
pnpm example:http-cache
Try this first
Section titled “Try this first”pnpm example:http-cacheExpected outcome
Section titled “Expected outcome”- the example warms a key, serves a stale read once, refreshes in the background, invalidates by tag, and prints metrics