caching-strategies
Caching patterns: cache-aside, write-through, stampede prevention, CDN headers, multi-level L1/L2/L3, cache invalidation. Use when designing caches or CDN strategy.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Caching Strategies
When to use
- Designing cache layers for high-traffic systems
- Preventing cache stampede / thundering herd
- Setting CDN/HTTP cache headers or cache invalidation strategy
Core principles
- Cache-aside is the default — application controls all cache interactions
- Always add jitter to TTL — ±10% prevents synchronized expiry stampedes
- Cache invalidation is harder than caching — design invalidation FIRST, then TTL
- Multi-level cache reduces latency multiplicatively — L1 (in-memory) → L2 (Redis) → L3 (DB)
- A cache miss should never cascade to DB overload — use lock-based prevention
References available
-
references/caching-patterns.md— cache-aside, write-through, write-behind, multi-level with code -
references/redis-deep-dive.md— data structures for caching, eviction policies, cluster mode -
references/cdn-edge-caching.md— Cache-Control headers, stale-while-revalidate, purge strategies -
references/cache-invalidation.md— stampede prevention, event-driven invalidation, versioned keys
Assets available
-
assets/caching-checklist.md— what to cache, TTL recommendations, monitoring queries
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-03-11
- Index updated
- 2026-03-11
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!