
The sales report page folds every sale row together on every single hit, although the table it reads changes a few times a day at most. Cache the whole page response for the defined window so a repeat request inside it never runs the aggregation, the first request after it does, and each query string keeps its own entry.
Read the full problemOne hot price lookup hammers the database from two different pages, and each caller either invented its own caching or did without. Centralize the lookup in a cache-aside helper that reads the cache, computes and stores on a miss under the documented key and timeout, and drops a product's entry whenever a price change or a delete makes it wrong.
Read the full problemEvery category page recomputes an expensive trending sidebar on every single request, while the rest of the page has to stay dynamic and must not be cached. Cache just the sidebar with a template fragment keyed by the category slug, leaving everything around it rendered per request.
Read the full problemThe storefront caches nothing: the product page rebuilds itself on every hit, the catalogue pays for every product's facts on every render, and a price change walks away leaving the figures it just made wrong on display. Put a page cache on the product page, a cache-aside helper behind every facts read and a cached fragment around each trending row, all keyed by product id, and make a price change drop exactly that product's three entries.
Read the full problem