⚙️ Backend Engineering · Caching & Queues
Layer caching with explicit invalidation
Decide what caches where (CDN, app, Redis) and how entries die so staleness stays bounded.
intermediate~35 minBackend EngineersAPI DevelopersPlatform Engineers
Steps
- 1Classify data: immutable (cache forever), mutable-TTL, never-cache (money)
- 2Cache at CDN for anonymous GETs with stale-while-revalidate
- 3Memoize expensive computed objects in-process with short TTL
- 4Use Redis for shared cross-instance state; set TTLs on everything
- 5Invalidate by key pattern on write events, not manual flushes
- 6Monitor hit-rate per layer; below 60% means wrong layer or wrong keys
Common Pitfalls
- ▲Caching authenticated responses at shared CDN edge
- ▲Thundering herd on expiry without jitter or locks
Commands
Install with skills CLI
$ npx skills add aniruddhaadak80/skills --skill caching-queues-cache-strategy-layersInstall globally
$ npx skills add aniruddhaadak80/skills --skill caching-queues-cache-strategy-layers -gTags
#caching#redis#cdn#backend-engineering#caching-queues