Add a Cache
Talk it through out loud with your AI coach.
The problem
- medium
- Pro
A product page is slow because every visit runs several database queries, and the database is near its limit at peak times. Explain how you'd add caching, what you'd cache and where, and how you'd keep users from seeing stale or wrong data.
What a strong answer covers
- Which data is a good candidate for caching and which should always be read fresh.
- Where the cache sits and how the application uses it.
- How cached data is kept fresh enough when the source changes.
- What can go wrong under heavy load and how to soften it.
Common mistake: Caching everything on the page, including data that must always be accurate, with no plan for when it changes.
Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.
Practise it out loud