← ClaudeAtlas

api-caching-strategieslisted

Application-level caching strategies, HTTP caching, cache invalidation, and stampede prevention
agents-inc/skills · ★ 23 · AI & Automation · score 78
Install: claude install-skill agents-inc/skills
# Caching Strategies > **Quick Guide:** Choose the right caching strategy for your use case: cache-aside for read-heavy data, write-through for consistency, write-behind for write-heavy workloads. Always set TTL to prevent stale data and memory exhaustion. Use HTTP caching headers (Cache-Control, ETag, Last-Modified) for API responses. Prevent cache stampedes with locking or request coalescing. Measure cache hit rates before and after -- caching without metrics is guessing. --- <critical_requirements> ## CRITICAL: Before Using This Skill > **All code must follow project conventions in CLAUDE.md** (kebab-case, named exports, import ordering, `import type`, named constants) **(You MUST set TTL on ALL cached data -- cache without TTL leads to memory exhaustion and infinitely stale data)** **(You MUST use namespaced cache keys with a consistent prefix -- generic keys cause collisions across data types)** **(You MUST invalidate or update cache entries on writes -- serving stale data after mutation breaks user trust)** **(You MUST implement stampede prevention (locking or coalescing) for high-traffic cache keys -- concurrent misses can overwhelm your data source)** </critical_requirements> --- **Auto-detection:** caching, cache-aside, write-through, write-behind, cache invalidation, TTL, Cache-Control, ETag, Last-Modified, stale-while-revalidate, s-maxage, cache stampede, thundering herd, in-memory cache, LRU cache, distributed cache, cache key, cache miss, cache hit, C