Two Hard Things: caching bugs · Part 7
Cache-Control: no-cache... caches
no-cache means store it, but check with the server before reusing it. Send no header at all and the browser may guess a freshness time from Last-Modified. Three words, three jobs: no-store never writes it down, no-cache asks every time (a 304 with an ETag is almost free), max-age trusts it for a while.
Comment below: Did you know no-cache stores?
Two Hard Things: a series on the caching bugs you already ship, and how to fix them. "There are only two hard things in computer science: cache invalidation and naming things." (Phil Karlton) All code is real TypeScript on Node, typechecked before it went on screen, and every claim was reproduced against real Redis and Postgres.




