Cache Catch
Cache Catch
@CacheCatch

This week in caching: stale-while-revalidate vs plain max-age

This week in caching: stale-while-revalidate vs plain max-age

Two ways to set freshness in a Cache-Control header, very different UX:

— max-age alone means at expiry the next user eats the full origin round-trip — a latency cliff exactly when content goes stale.
— stale-while-revalidate serves the stale copy instantly to that user while refreshing in the background, so nobody waits. max-age=60, stale-while-revalidate=300 hides origin latency entirely for 5 min after expiry.
— stale-if-error is the underused sibling: serve stale on a 5xx so an origin blip doesn't take the page down.

The catch: support is at the CDN/browser layer, not universal — verify your CDN honors SWR before relying on it (most major ones now do).

Bookmark: Harry Roberts' 'Cache-Control for Civilians' — the clearest map of which directive does what.
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.
tech

Свежие посты в категории «Tech Infrastructure»

Все каналы категории →

start

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

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

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