nestjs-caching

Installation
SKILL.md

Caching & Redis Standards

Priority: P1 (OPERATIONAL)

Caching Strategy

  • Layering: Use Multi-Level Caching for high-traffic read endpoints.
  • L1 (Local): In-Memory (Node.js heap). Ultra-fast, no network. Use lru-cache for config/static data.
  • L2 (Distributed): Redis. Shared across pods.
  • Pattern: Implement Stale-While-Revalidate to avoid latency spikes during cache misses.

NestJS Implementation

  • Library: Use cache-manager with cache-manager-redis-yet (recommended over cache-manager-redis-store for V4 stability).
  • Interceptors: Use @UseInterceptors(CacheInterceptor) for simple GET responses.
  • Warning: Default key URL. Ensure consistent query param ordering or use custom key generators.

See implementation examples

Installs
1
GitHub Stars
521
First Seen
14 days ago
nestjs-caching — hoangnguyen0403/agent-skills-standard