A NestJS-specific caching library that integrates Redis for response caching. Current stable version is 1.2.4 with a monthly release cadence. It provides a RedisService and a @Cache decorator for controller methods. Unlike generic cache-manager, this package is tailored for NestJS decorators and environment-based configuration (REDIS_HOST, REDIS_PORT). It includes TypeScript types and works with NestJS modules.
npm install nest-cache-managerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to set up RedisService in a module and use @Cache decorator on a controller method.
Always provide both arguments: @Cache('myKey', 60).Set REDIS_HOST and REDIS_PORT in your .env or process.env.
Wrap the RedisService in a custom module with error handling or health checks.
Run 'npm install nest-cache-manager' and ensure your tsconfig.json includes node_modules types.
Apply @Cache only to methods in classes decorated with @Controller().