Cache key
when doing
fetch
, one of the enterprise features is to cache the fetch by a specific cacheKey, although for non-enterprise customers, what is the cache key instead? the URL ? or the request object as a whole?7 Replies
The default cache key is explained at the top of this document https://developers.cloudflare.com/cache/how-to/cache-keys/
Cloudflare Docs
Cache Keys · Cloudflare Cache (CDN) docs
A Cache Key is an identifier that Cloudflare uses for a file in our cache, and the Cache Key Template defines the identifier for a given HTTP request. …
does it include method it doesnt explicitly say ?
wth is
x-http-method-override
headersonly GET and HEAD are cached anyway, and if a GET is cached then HEAD will use that cache
Makes sense thank you
also default ttl is not mentioned, and
cacheEverything
is not really explained. what is the default ttl and what does cacheEverything do exactly? doesnt default cache behaviour already cache everything ?
and is cacheTtlByStatus
mandatory? as i dont think anyone wants to cache a 400-500
status responseThey're documented here https://developers.cloudflare.com/cache/how-to/configure-cache-status-code/#edge-ttl
If you don't specify cacheTtlByStatus then the ttls on that table are used and status codes not there aren't cached
Cloudflare Docs
Cache by status code · Cloudflare Cache (CDN) docs
Enterprise customers can set cache time-to-live (TTL) based on the response status from the origin web server. Cache TTL refers to the duration of a …
Cache-control response headers can override behaviour there though
what about
cacheEverything
?
also thanks for pointing out the documentation parts. im not sure how im missing them even though im looking thoroughly