304 `REVALIDATED` `CF-Cache-Status` cache header
See original GitHub issueI’m using this code
const data = await getAssetFromKV(event)
return new Response(data.body, data)
and I’m unable to use the cache. I keep getting MISS
by checking the request in devtools
I can see that it’s set to false
by default
https://github.com/cloudflare/kv-asset-handler/blob/f9bb072da86ec91ae8bb3b0cd06b219e26d638c2/src/index.ts#L159
and only set to true
if we use ASSET_MANIFEST
https://github.com/cloudflare/kv-asset-handler/blob/f9bb072da86ec91ae8bb3b0cd06b219e26d638c2/src/index.ts#L160-L167
Is this intended or I’m missing something?
Issue Analytics
- State:
- Created 2 years ago
- Comments:11
Top Results From Across the Web
304 Status - General - Cloudflare Community
Mainly the Status 304 and the cf-cache-status:REVALIDATED. Request Method:GET Status Code:200 (from memory cache).
Read more >When my origin serves a "304 Not Modified", Cloudflare sends ...
Basically, I'm instructing the browser here to cache the response for 5 minutes. Along with these headers I also send an etag across....
Read more >New HTTP standards for caching on the modern web
The Cache-Status Header · Targeted Cache-Control Headers. These are designed to update HTTP standards to match the reality of the CDN-powered web that...
Read more >Cache-Control - HTTP - MDN Web Docs
The Cache-Control HTTP header field holds directives ... The must-revalidate response directive indicates that the response can be stored in ...
Read more >Status 200 (from disk cache) and 304 Not Modified issue
For each request I also manually add Cache-Control header res. ... must-revalidate cf-cache-status: HIT cf-ray: 618ac665c984351f-KBP ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for sharing!
Ah I see - that makes total sense. I wasn’t replicating it because I had
disable cache
enabled in my dev tools. Good catch!Since the edge cache is definitely being hit (you can see from the
age
header), this isn’t so much a problem, but I’ll leave this issue open for discussion about if anything should change with the304
response.