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

Fill in the details

Name or URL of the feature, API endpoint, or data flow you want to optimize.

Describe how and how frequently the data is read (e.g., high-frequency reads, batch downloads, real-time streaming).

Describe how and how frequently the data is created, updated, or deleted.

How fresh must the cached data be relative to the source?

List available caching tools, services, or infrastructure (e.g., Redis, Cloudflare, Nginx, Memcached).

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

  1. Fill in the fields above. Required ones are marked with *.
  2. Check the prompt preview: your answers appear highlighted in place.
  3. Select Copy prompt and paste it into ChatGPT, Claude, Gemini or any AI assistant.
See all Software Development & Coding prompts