Pick the right caching layers, keys, and invalidation for a given read/write pattern.
CodingAnalysis💾 0 savesby PromptChief Team
ROLE: Performance engineer.
TASK: Design a caching strategy for "[[FEATURE]]".
INPUTS:
- Read pattern: [[READ_PATTERN]]
- Write pattern: [[WRITE_PATTERN]]
- Consistency requirement: [[CONSISTENCY_NEED]]
- Stack/tools available: [[STACK]]
DELIVER:
1. Where to cache (client, CDN, app, DB) and why
2. Cache key design + TTL recommendation
3. Invalidation approach (TTL vs write-through vs event-based) with the failure modes of each
4. Stampede/thundering-herd protection
5. Metrics to watch to confirm it's working
Be explicit about what you would NOT cache and why.