Spec a Redis cache for hot product pages
Your task
Your Go service builds product pages from a database query that takes about 300 ms. You want a read-through cache in Redis: check the cache, and on a miss, load from the database and store the result with a TTL, a time to live. A coding agent will build GetOrLoad(ctx, key, loader). The top 100 products get about 5,000 reads a second each, across 20 service instances.
Write the spec you would hand the agent.
What you know:
- product data may be up to 60 seconds stale
- some product ids do not exist, and bots request them in bulk
- the managed Redis has had short outages this year
- the database handles about 200 of these queries a second before it slows down
Then, in a few sentences: what does "add a Redis cache with a TTL" get wrong under real traffic?