Skip to content
CORE/learn/caching-flow
BACK_TO_MAP
DOMAIN::performancePerformance & Caching

Caching (HTTP, CDN, Client)

"Storing responses for faster future access."

Real_World_Analogy

Keeping a snack in your pocket instead of going back to the fridge every time you're hungry.

Constraints_&_Tradeoffs

  • A cached copy is only correct while its freshness lifetime holds.
  • Revalidation costs one conditional request instead of a full response body.
  • A shared cache answers for many clients at once, so one wrong header is wrong for all of them.
INTERACTIVE_TRACE
TRACE::LAYERED_CACHE_FLOW
METHOD::LAYERED_CACHE_FLOWcaching-flow
STORED_COPY::FRESHNESS
FRESHNESS_LIFETIME

max-age is a promise with an expiry. Until it expires a copy may answer; after it, the copy has to be confirmed or replaced.

WHAT_THE_CLIENT_SEES

the fastest response is the one the network never carries

REQUEST_DEPTH::1/3
client cacheHIT

the response never leaves the device

shared cacheNOT REACHED

the request never gets this far

originNOT REACHED

the request never gets this far

CLIENT_EXPERIENCE

0 network round trips — the response never left the device

Illustrative_Specimen

GET /reports/<report-id> HTTP/1.1
If-None-Match: "<entity-tag>"
---
304 Not Modified    the cached copy is still valid
Cache-Control: max-age=<seconds>

Placeholders in <angle-brackets>. Illustrative message shapes, not a description of any specific API.