RFC 9111: The Rulebook for Copies That Outlive Their Originals

Every cache on the Internet is a copy that has been handed permission to speak for the original. RFC 9111 — the IETF's HTTP Caching specification, published in June 2022 and the successor to RFC 7234 — decides how long that permission lasts, what evidence the copy must produce when someone challenges it, and which two requests count as the same question in the first place.

That last clause is where the trouble lives. A cache does not lie. It repeats, faithfully and at the speed of the nearest edge, a sentence the origin has already retracted — to an audience with no way of knowing the original moved on.

Written by Roy Fielding, Mark Nottingham and Julian Reschke, RFC 9111 sits in the 9110 series alongside HTTP Semantics (RFC 9110), HTTP/1.1 (RFC 9112), HTTP/2 (RFC 9113) and HTTP/3 (RFC 9114). It is one of the few standards documents that doubles as a job description: browsers, CDNs, reverse proxies, service meshes and that forgotten Squid box in a Frankfurt basement all implement it, well or badly, every millisecond of the day.

What RFC 9111 Actually Governs: Four Questions, One Contract

Strip away the syntax and the specification answers four questions, in order.

How long may this copy speak? That is freshness. How do we check whether it is still true? That is validation. Which requests is this copy allowed to answer? That is the cache key, and the Vary header field. What happens when the original changes? That is invalidation — the shortest section and the longest list of production incidents.

Everything else in the document is bookkeeping around those four. Get them right and the network gets faster for free. Get them wrong and you have built a machine for confidently repeating yesterday.

Freshness: The Clock You Set Once and Forget for Two Years

Freshness is arithmetic, not judgement. A response carries max-age, or s-maxage for shared caches, or an Expires date, and the cache subtracts the Age it has already accumulated. When the number goes negative, the copy is stale and must be validated before reuse.

The trap is that freshness is set by whoever wrote the header, usually once, usually in a hurry, and then inherited by every cache on the planet. A max-age of 31536000 is a one-line commitment to repeat an answer for a year.

Worse is the case with no explicit expiration at all. RFC 9111 permits heuristic freshness, and encourages a heuristic of roughly ten percent of the interval since Last-Modified. A page untouched for a decade can therefore be cached, without anyone deciding anything, for about a year. The same logic applies to the status codes the specification treats as heuristically cacheable — including 301 and 404. A redirect cached for twelve months is a road sign pointing at a building that has been demolished. A 404 cached for twelve months is a tombstone in the lobby.

Validators: ETag, Last-Modified and the Cheapest Sentence in Networking

A validator is the copy's alibi. The origin stamps the response with an ETag — an opaque fingerprint, strong or weak — or a Last-Modified date. The cache later sends If-None-Match or If-Modified-Since, and the origin replies with the whole body or with 304 Not Modified.

That 304 is the most efficient sentence in networking: a few dozen bytes meaning "still true, carry on." It is also the difference between a cache that can be corrected in milliseconds and one that cannot be corrected at all until the clock runs out.

Which is why the dangerous configuration is not a long lifetime. It is a long lifetime with no validator. The copy has been granted a year of authority and no way to resign it early. When the origin changes its mind, nobody finds out at the speed of the network. They find out at the speed of the cache.

Vary: Which Two Requests Count as the Same Question

Here is the part most teams read once and misapply forever. A cache key is not a URL. It is a URL plus the request header fields named in Vary. That is the entire mechanism by which a cache decides whether two requests are the same question.

Vary: Accept-Encoding is the sensible, load-bearing case: a gzip body and a brotli body are different answers to the same URL, and the cache must not hand one to a client that asked for the other. Vary: * is the specification's way of saying the response never matches — effectively "do not reuse this for anyone."

And then there is Vary: User-Agent, the classic footgun. Every distinct user-agent string becomes a distinct cache entry. Hit ratio collapses, memory climbs, and the origin server that was supposed to be shielded ends up serving the fragmentation the cache was meant to absorb. The cache key is a budget. Vary is how you spend it.

Invalidation: A Local Rule in a Global System

RFC 9111 says a cache must invalidate the stored response for a URI when it sees a successful unsafe request — a POST, PUT, PATCH, DELETE — against that URI. This is correct, necessary, and structurally incomplete.

It only applies to caches that saw the write. The edge node in Singapore that handled the update invalidates its copy; the edge node in São Paulo, which never saw the request, keeps answering with the old one until its freshness expires. There is no global broadcast in HTTP caching. There is only the clock, and the hope that everyone set it to the same number.

This is the honest core of the whole specification: caching is a distributed-systems problem wearing a header field's clothing, and RFC 9111 is the closest thing the industry has to a shared set of terms for arguing about it.

no-cache Is Not no-store: A Field Guide to Expensive Misreadings

  • no-store — do not write it down at all. The strictest instruction, and the one people usually mean.
  • no-cache — write it down, but never reuse it without checking with the origin first. It is a revalidation rule, not a storage ban. Confusing the two is the most common caching bug in production.
  • private vs public — who is allowed to keep the copy. A browser and a CDN are not the same audience, and a response marked private that lands in a shared cache is a data-leak story with a slow fuse.
  • s-maxage — the shared-cache override. It beats max-age and Expires for CDNs and proxies, which is exactly why it is so often forgotten.
  • must-revalidate — once stale, no reuse without a successful check. It closes the serve-stale-when-the-origin-is-unreachable loophole that otherwise opens at the worst possible moment.

Two popular directives are not in RFC 9111 at all, which surprises people who assume otherwise. stale-while-revalidate lives in RFC 5861. immutable, honoured by browsers, lives in RFC 8246. The specification is a floor, not a ceiling — and the extensions are where most of the operational nuance actually sits.

Why a 2022 RFC Still Outranks Your CDN Dashboard

Because it is running code, and running code is the only kind of authority the Internet has ever respected. RFC 9111 is not a policy recommendation or a best-practice note. It is implemented — in Chrome and Firefox, in Varnish and nginx, in every major CDN edge, in the service-mesh sidecar quietly rewriting your headers. When it changes, the network changes. When a vendor's dashboard disagrees with it, the dashboard is wrong.

The document's lineage makes the point: RFC 2616 in 1999, RFC 7234 in 2014, RFC 9111 in 2022. Each generation tightened the same four questions and removed a little more ambiguity. That is what a working standard looks like — not a declaration, a patch series.

The Copy Is a Rumour With an Expiry Date

The original is the truth. The copy is a rumour that has been licensed to travel, and every cache on the path is a wager that nothing has changed since the last time somebody checked. RFC 9111 does not eliminate the wager. It just makes you write down the odds — and, if you have any sense, attach an ETag.

A cache with a long lifetime and no validator is not a performance optimisation. It is a promise you cannot take back, repeated at the speed of light, to everyone who asks.