A Koa middleware for caching HTTP responses in Redis. Version 3.0.3 is the latest stable release. The package allows developers to easily cache responses for specified routes with configurable expiration times, customizable Redis key prefixes, and exclusion patterns. It supports per-route expire settings and sets a custom `X-Koa-Redis-Cache` header when serving from cache. Compared to other Koa caching middleware, it is lightweight and Redis-specific, but note it is not actively maintained.
npm install koa-redis-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up Koa with redis cache middleware for route /index with 60-second expiration.
Install @types/koa-redis-cache or create a declaration file.
Use ioredis or consider alternative like koa-redis-cache-io.
Wrap redis options under `redis` object: { redis: { port: 6379, host: 'localhost' } }.Start Redis server or configure correct host/port in options.
Use `const cache = require('koa-redis-cache')` or `import cache from 'koa-redis-cache'`.