Caching Strategy Designer
Design a robust, production-ready caching strategy for the specified feature, endpoint, or data flow.
- Category
- Software Development & Coding
- Output
- Markdown
- Fields
- 5
- software-development
- data-structuring
- workflow-design
- cache-strategy
Prompt
You are a senior performance engineer and systems architect specializing in distributed caching and data consistency. Your task is to design a robust, production-ready caching strategy for the specified feature, endpoint, or data flow.
Analyze the provided read and write patterns alongside the consistency requirements. Recommend specific caching layers (e.g., browser/client, CDN, reverse proxy, application memory, distributed cache, database query cache) and justify each choice based on latency, cost, and data freshness. Define a clear cache key naming convention and suggest appropriate TTL ranges. Evaluate invalidation strategies (e.g., time-based, write-through, write-behind, event/pub-sub) and explicitly discuss the failure modes and trade-offs of your chosen approach. Propose mechanisms to prevent cache stampedes or thundering herds (e.g., mutex locks, probabilistic early expiration, jitter). List 3-5 key metrics or monitoring signals to validate the strategy's effectiveness in production. Clearly state what should NOT be cached and the reasoning behind each exclusion.
If any input is missing or ambiguous, proceed with reasonable engineering defaults but flag assumptions in a brief "Open questions" section. Do not invent specific metrics, tool names, data volumes, or architectural details not provided in the inputs.
Deliver your response in Markdown using the following structure:
1. **Caching Layers & Placement**: Where to cache and why
2. **Key Design & TTL**: Cache key naming convention and time-to-live recommendations
3. **Invalidation Strategy**: Chosen approach with failure modes and trade-offs
4. **Stampede Protection**: Mechanisms to prevent thundering herds
5. **Monitoring & Metrics**: Key signals to track in production
6. **Exclusions**: What not to cache and why
7. **Open Questions**: Assumptions made or missing details that need confirmation
Inputs to use:
- Target: Feature or endpoint
- Read pattern: Read pattern
- Write pattern: Write pattern
- Consistency requirement: Consistency requirement
- Tech stack: Tech stack
How to use this prompt
- Fill in the fields above. Required ones are marked with *.
- Check the prompt preview: your answers appear highlighted in place.
- Select Copy prompt and paste it into ChatGPT, Claude, Gemini or any AI assistant.
More Software Development & Coding prompts
- Bug Fix Brief for an AI AgentConvert raw bug reports into precise, unambiguous execution briefs tailored for AI coding agents.
- Database Schema Designer NormalizedProduce a production-ready, normalized relational schema with precise constraints, justified indexes, and practical migration guidance.
- Production Error Log TriageROLE: You are a senior on-call SRE and incident response engineer specializing in production debugging.
- Bug Diagnosis and FixYou are an expert software engineer and debugging specialist.
- Conventional Commit Message WriterROLE: You are a senior software engineer and version control specialist dedicated to maintaining clean, standardized, and highly readable Git history.
- Dockerfile Optimizer and HardenerROLE: Senior DevOps Engineer and container security specialist.