backend-caching
Installation
SKILL.md
Backend Caching
Use this skill when
- Caching queries and API responses
- Choosing cache tiers (in-memory, Redis, CDN)
- Invalidation strategies
Do not use this skill when
- The data changes every request (caching is a liability)
- Frontend/browser caching
Instructions
- Cache only data that is read-heavy and tolerates staleness.
- Key caches by full query context; include version in keys where schemas evolve.
- Choose scoped invalidation: explicit evict on write, or TTL with tolerance.
- Use cache-aside vs write-through deliberately.
- Protect from stampede: single-flight/mutex on cache miss.
- Set TTLs with business-appropriate staleness.
- Monitor hit-rate and correctness (a wrong cache is worse than no cache).