packages/miniflare/src/workers/cache/README.md
The Cache API within workerd is extremely lenient with errors, and will work
with a service that doesn't fully support the expected API. This is what it
should behave like:
Unimplemented in the runtime
Unimplemented in the runtime
workerd guarantees:
GETCache-Control: only-if-cached (which
Miniflare ignores)Cf-Cache-Namespaces if this is a namespaced
cache (i.e. caches.open(...)) workerd expects:Cf-Cache-Status header to be present with the value:
MISS if it's a cache miss, in which case the rest of the response is
ignored by workerdHIT if it's a cache hit, in which case workerd sends the response on to
the user, including the full headers and full bodyworkerd guarantees:
PUT, and the cache key method will always be GETCf-Cache-Namespaces if this is a namespaced cache
(i.e. caches.open(...))206 status code - Have a
Vary: * header - Have a 304 status code workerd expects:204 (success) or 413 (failure) response code. It doesn't do anything
with eitherworkerd guarantees:
PURGE, and the cache key method will always be
GETCf-Cache-Namespaces if this is a namespaced cache
(i.e. caches.open(...))X-Real-IP will be set to 127.0.0.1workerd expects:200 on success404 on failure429 on rate limit (which will throw in the user worker)