Notes on HTTP caching
yulia 10219ee912421f0b · · 中文 · 日本語

Notes on HTTP caching

I look this up every time, so here's the note I keep needing.

Two kinds of caching

Kind Behavior Headers
Fresh no request at all Cache-Control: max-age=…, Expires
Conditional asks the server if it changed ETag / If-None-Match, Last-Modified / If-Modified-Since

In practice

  • Fingerprinted assets: max-age=31536000, immutable
  • HTML: no-cache (revalidate every time), or a very short max-age
  • Only no-store means truly no caching; no-cache means revalidate

Biggest misconception: no-cache does not mean "don't cache".