Caching strategies

From rnavarych/alpha-engineer · View interactive version

Caching strategies is an AI agent skill from the GitHub repository rnavarych/alpha-engineer. Implements caching solutions using Redis patterns (cache-aside, write-through, write-behind), Memcached, cache invalidation strategies, TTL design, cache stampede prevention, CDN configuration, and distributed caching. Use when optimizing read performance, reducing database load, designing cache lay

How to use this skill

Skill file

Caching Strategies

When to use

Core principles

  1. Pattern before implementation — cache-aside, write-through, and write-behind have different consistency trade-offs; pick deliberately
  2. TTL jitter is mandatory at scale — synchronized expiration = thundering herd; add 10-30% random variance
  3. Hit rate is the only real metric — target >90%; anything lower means either wrong keys or wrong TTLs
  4. Stale is often fine — serve stale data while revalidating in background rather than blocking on a miss
  5. Cache is not storage — set maxmemory-policy allkeys-lru and accept eviction; anything that can't be lost belongs in the database

Reference Files

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.