https://ldnwebperf.org/events/caches-all-the-way-down/
(kind of Chromium specific here and there)
- same rendering process, short-lived
- strict matching, same resource type, etc, CSP
- everything (even
no-cache
, except forno-store
) - not shown in dev-tools or in Resource Timing
- not bound to HTTP semantics
- explicit API, controlled by the web developer
- not bound to HTTP semantics
- yay, made it to the network stack
- bound to HTTP semantics
- unclaimed push stream container
- only on same H2 connection
- https://jakearchibald.com/2017/h2-push-tougher-than-i-thought/
- goes into HTTP cache once 'claimed' by a request
- lost after 5 mins unless claimed (in Chromium)
- user -> isp -> edge -> internet -> reverse proxy -> origin
- once got the response:
- HTTP cache (if cacheable)
- ServiceWorker can decide to cache
- resource timing
- MemoryCache
- the URL is the cache key
- freshness
- validators:
- res:
ETag
,Last-Modified
, - req:
If-None-Match
,If-Modified-Since
- but! 1 RTT penalty
- res:
- scope matters, too: is it private (browser) or a (shared) public proxy
Expires
: define datePragma: no-cache
nah, old, abused
max-age
- in secondss-max-age
- max age for shared proxies,immutable
- never revalidatemust-revalidate
- must revalidate if freshness ran outno-cache
- caches but revalidatesno-cache=set-cookie
- can be cached but ignore headerno-store
- kind of does what it doesproxy-revalidate
- must-revalidate for proxiesno-transform
- e.g image/JS minifying proxiesstale-while-revalidate
- can serve stale, but revalidate at the same time (fairly new)- scope:
public
/private
- user vs public caches - by default: can cache (except for URLs with params in old implementations)
- controls your own public cache, not well-defined, spec not great
- caching proxies must add this header to cached responses
- response depends on headers
- example: image width, encoding, normalized UA
- creating complex cache keys, with partitions
Cache-Control: max-age=<year> immutable
Cache-Control: max-age=0 must-revalidate
- and can be a gamble
- CDNs usually use this too
- providing API to purge
- can purge from cache with API
- e.g. purge based on a refresh list served up somewhere
- just an idea for now
- no browser support