Design a caching strategy
Define what to cache, which cache type to use, TTLs, eviction policies, cache key schema, and a cache stampede prevention strategy.
Preview
Copy prompt
Design a comprehensive caching strategy for [System]. Begin by identifying what data is worth caching based on read frequency, computation cost, and tolerable staleness. Recommend the appropriate cache type for each category: in-process memory, a distributed cache, or a CDN. Define a TTL for each cached resource. Design a cache key schema that avoids collisions between different tenants or contexts. Describe the eviction policy. Explain how to handle a cache stampede when a popular key expires under high traffic using a lock, probabilistic early expiry, or background refresh.
More
Architecture
Prompts
