English | Русский
High-performance LRU caching plugin for Hyperttp with TTL support and concurrent request deduplication.
- In-memory LRU cache with configurable TTL and size limits.
- Concurrent request deduplication and cache stampede protection.
- HTTP revalidation with
ETagandLast-Modified. - Core v2 plugin lifecycle integration.
npm install @hyperttp/cache
# or
bun add @hyperttp/cacheimport { HyperClient } from "hyperttp";
import { withCache } from "@hyperttp/cache";
const client = new HyperClient({
plugins: [withCache()],
});
const response = await client.get("https://api.example.com/data");Configure the plugin with the exported CacheOptions type. Cache behavior is controlled by
options such as enabled, ttl, maxSize, methods, and touchOnGet.
MIT © dirold2