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.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
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
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!