Edge of Glory
Edge of Glory
@EdgeOfGloryCDN

The myth of Vary: User-Agent for mobile

A Manila travel site added Vary: User-Agent to serve mobile pages, following a tutorial. Their cache-hit ratio collapsed to 11% overnight.
The myth: vary on User-Agent to handle devices. The reality: there are thousands of unique User-Agent strings. Every browser version, every device, became a separate cache entry. They had effectively disabled caching.
What we changed: we removed the Vary header, switched to a responsive design served from one cached HTML document, and used CSS media queries instead of server-side device sniffing.
Result: cache-hit ratio recovered to 92%, Manila TTFB dropped from 480ms to 35ms, and origin load fell by an order of magnitude.
Vary on User-Agent shatters your cache into infinite fragments. Respond responsively, cache once.
The number that mattered: 92% cache-hit, back from 11%.
This post was published in the Telegram channel Edge of Glory (@EdgeOfGloryCDN). All its posts are on the channel page.
Open on Telegram

Latest posts in “Tools and infrastructure”

All channels in this category →

реклама в сети

Готовы запустить рекламу через сеть public.tg?

Новый оффер, продукт, GEO, кейс, событие или партнёрский запуск — соберём маршрут под задачу и отдадим медиаплан.

Telegram для медиаплана: @AFFtop_connect. Быстрый тест: $20 за канал, $1000 за пакет по сети.