Analyze cache invalidation and freshness | DevPrompt Lab
Map cache keys, stale-data risks, and invalidation triggers before optimizing reads.
prompt · Performance · intermediate
English Tiếng ViệtA structured analysis that considers user scope, locale, writes, and acceptable staleness together.
Reusable content
Analyze the data flow and cache proposal. Identify cache layers, key dimensions, ownership and locale scope, TTL, invalidation events, and what happens when invalidation fails. Determine which reads may serve stale data and for how long the product can tolerate it. Check that private data cannot collide across users. Recommend the simplest strategy that meets the freshness requirement and include a test for key separation and invalidation.
Data flow: {{DATA_FLOW}}
Cache layer: {{CACHE_LAYER}}
Freshness requirement: {{FRESHNESS_REQUIREMENT}}
How to use it
Include read/write paths and expected concurrent update behavior.
Example
Key: resource:{id}:{locale}. On translation update, evict only that locale key; never share authenticated project data in a public cache.