This week in caching: full-page cache pitfalls (and the fixes)
Where aggressive page caching bit teams, with the after-numbers:
— Retailer — full-page cache served one logged-in user's cart to everyone for 11 minutes; root cause was caching with a Set-Cookie present. Fix: bypass cache when a session cookie exists, plus ESI for the cart fragment. Hit rate stayed at 85%.
— Forum — cached 'You are logged in as X' in the header; fixed by hole-punching the user widget via edge-side includes, keeping the rest cached.
— Store — currency switcher leaked because the cache key ignored the geo cookie; adding it to the Vary key cost 4% hit rate but ended the support tickets.
The rule: cache the page, hole-punch the person.
Bookmark: grep your responses for Set-Cookie on cacheable URLs — that's the #1 leak source.
Cache Catch
@CacheCatch
This week in caching: full-page cache pitfalls (and the fixes)
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.