Vary header vs. edge cache-key normalization: a Milan site rescues hit ratio
A travel site varied its cache on the full Accept-Language header. Browsers send messy values — 'en-US,en;q=0.9,it;q=0.8' versus 'en-GB,en;q=0.7' — so the edge stored a separate copy per variant. Cache-hit ratio sat at 58%.
Origin in Milan handled thousands of near-duplicate misses.
They dropped the Vary and instead normalized the cache key in an edge function: collapse the header down to one of three buckets — en, it, or default — before lookup.
Distinct cache entries per page fell from dozens to three. Hit ratio jumped from 58% to 91%.
Vary is honest and simple when values are clean and few. Edge key normalization wins when clients send high-cardinality headers you can safely bucket.
The number that mattered: cache-hit ratio from 58% to 91%.
Edge of Glory
@EdgeOfGloryCDN
Vary header vs. edge cache-key normalization: a Milan site rescues hit ratio
Этот пост опубликован в Telegram-канале Edge of Glory. Подписаться можно по ссылке: @EdgeOfGloryCDN.