This week in caching: revalidation done right (304s)
Three pieces on conditional requests — the half of caching people skip.
— ETag vs Last-Modified — ETags are precise but break across load-balanced servers if not normalized (Apache's inode-based default is a classic gotcha). Last-Modified is coarser but stable.
— weak vs strong ETags — W/"..." allows semantically-equal matches; use weak for gzip-varying responses or you'll never get a 304.
— 304 still costs a round-trip — revalidation isn't free; pair it with a real max-age so you skip the network entirely on fresh assets.
Bookmark: the MDN conditional-requests page — the weak-ETag-plus-compression gotcha alone is worth the read.
Cache Catch
@CacheCatch
This week in caching: revalidation done right (304s)
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.