ngxtm/devkit/caching

Claude Code and agent skill by ngxtm/devkit

Trust tier 2
  • community
LLM review pending
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/caching

SKILL.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-manager with cache-manager-redis-yet (Recommended over cache-manager-redis-store for 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 (KEYS is O(N) - bans in PROD), use Sets to group keys.
  • _Create_: SADD post:1:tags cache:post:1
  • _Invalidate_: Fetch tags from Set, then DEL usage 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 swr libraries).

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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ngxtm/devkit/caching/badge)](https://verified-skill.com/skills/ngxtm/devkit/caching)

Something wrong with this skill or its page? Tell us.