Cache Catch
Cache Catch
@CacheCatch

This week in caching: ETag vs Last-Modified for revalidation

This week in caching: ETag vs Last-Modified for revalidation

Both let a browser ask 'has this changed?' and get a cheap 304 — but they fail differently:

— Last-Modified is one-second granularity and clock-dependent. Fine for static files that change rarely; useless for content that updates sub-second.
— ETag is a content hash — precise, immune to timestamps. Better for dynamic responses.
— The multi-server trap: default Apache/Nginx ETags include the file inode, which differs across servers behind a load balancer, so the same file gets different ETags and revalidation breaks. Either strip the inode component or pin ETags to content only.

For a CDN-fronted static asset, skip revalidation entirely and use a fingerprinted filename with immutable — no conditional request at all beats a fast 304.

Bookmark: Ilya Grigorik's 'HTTP caching' chapter in High Performance Browser Networking.
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.
tech

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

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

start

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

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

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