This week in caching: Edge Side Includes (ESI) cases
Caching the page and the fragments at different TTLs:
— News portal — the article body cached for 1 hour, the 'trending now' sidebar via ESI for 60s; one page, two cache lifetimes, hit rate stayed at 93% while trending stayed fresh.
— Store — mini-cart as an ESI fragment meant the catalog page cached fully for everyone while the cart stayed per-user; full-page cache hit rate jumped from ~40% (uncacheable due to cart) to 88%.
— Membership site — login state hole-punched via ESI let anonymous and member views share one cached shell.
The pattern: ESI is how you stop one dynamic widget from making a whole cacheable page uncacheable.
Bookmark: Varnish ESI docs + the <esi:include> gotchas around gzip — read before shipping.
Cache Catch
@CacheCatch
This week in caching: Edge Side Includes (ESI) cases
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.