@hono-crud/cache
v0.1.10
Published
Caching mixins and storage backends for hono-crud
Downloads
1,560
Maintainers
Readme
@hono-crud/cache
Caching mixins and storage backends for hono-crud.
Install
npm install @hono-crud/cache hono-crud honoUsage
import { createStorageMiddleware } from 'hono-crud';
import { MemoryCacheStorage } from '@hono-crud/cache';
// Inject the storage into context so cache-enabled endpoints / mixins resolve it.
app.use('*', createStorageMiddleware({
cacheStorage: new MemoryCacheStorage(),
}));Exports cache storage backends (e.g. MemoryCacheStorage) and the caching mixins used by hono-crud endpoints.
cacheConfig.ttl is in seconds; the CacheStorage.set boundary works in milliseconds (ttlMs). On Cloudflare KV, expirationTtl is floored to 60s.
