ngxtm/devkit/caching
Claude Code and agent skill by ngxtm/devkit
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Multi-level caching, Invalidation patterns, and Stampede protection.
Install
npx vskill@latest install ngxtm/devkit/cachingSKILL.md
Caching & Redis Standards
Caching Strategy
- Layering: Use Multi-Level Caching for high-traffic read endpoints.
- L1 (Local): In-Memory (Node.js heap). Ultra-fast, no network. Ideal for config/static data. Use
lru-cache. - L2 (Distributed): Redis. Shared across pods.
- Pattern: Implement Stale-While-Revalidate where possible to avoid latency spikes during cache misses.
NestJS Implementation
- Library: Use
cache-managerwithcache-manager-redis-yet(Recommended overcache-manager-redis-storefor better V4 support and stability). - Interceptors: Use
@UseInterceptors(CacheInterceptor)for simple GET responses. - Warning: By default, this uses the URL as the key. Ensure consistent query param ordering or custom key generators.
- Decorators: Standardize custom cache keys.
``typescript @CacheKey('users_list') @CacheTTL(300) // 5 minutes findAll() { ... } ``
Redis Data Structures (Expert)
- Don't just use
GET/SET. - Hash (`HSET`): Storing objects (User profiles). Allows partial updates (
HSET user:1 lastLogin result) without serialization overhead. - Set (`SADD`): Unique collections (e.g., "Online User IDs"). O(1) membership checks.
- Sorted Set (`ZADD`): Priority queues, Leaderboards, or Rate Limiting windows.
Invalidation Patterns
- Problem: "There are only two hard things in Computer Science: cache invalidation and naming things."
- Tagging: Since Redis doesn't support wildcards efficiently (
KEYSis O(N) - bans in PROD), use Sets to group keys. - _Create_:
SADD post:1:tags cache:post:1 - _Invalidate_: Fetch tags from Set, then
DELusage keys. - Event-Driven: Listen to Domain Events (
UserUpdated) to trigger invalidation asynchronously.
Stampede Protection
- Jitter: Add random variance to TTLs (e.g., 300s ± 10s) to prevent all keys expiring simultaneously.
- Locking: If a key is missing, one process computes it while others wait or return stale. (Complex, often handled by
swrlibraries).
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingrules/nestjs/caching/SKILL.md
Popularity
- Repository stars
- 8
- Repository forks
- 5
- 7-day trend score
- 16
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ngxtm/devkit/caching)