Hello , i have a question regarding caching through fetch API : https://developers.cloudflare.com/wo
Hello , i have a question regarding caching through fetch API : https://developers.cloudflare.com/workers/examples/cache-using-fetch/
let's say i have a worker that i want to fetch data from and cache this data for an hour so that the next request the data should be taken from the cache.
So i am expecting for the same request with in my window of an hr, the 2nd fetch response would be taken from the cache not go to make another http request correct ?
if this is the case why for every fetch request i do the worker gets called and returns the response?
How can i validate that this is from the cache or not?
i have set
is there somethig i should add ?
let's say i have a worker that i want to fetch data from and cache this data for an hour so that the next request the data should be taken from the cache.
So i am expecting for the same request with in my window of an hr, the 2nd fetch response would be taken from the cache not go to make another http request correct ?
if this is the case why for every fetch request i do the worker gets called and returns the response?
How can i validate that this is from the cache or not?
i have set
cf: {
cacheTtl: 3600,
cacheEverything: true,
}, in my fetch request.is there somethig i should add ?
Cloudflare Docs
Setting the cache level to Cache Everything will override the default cacheability of the asset. For time-to-live (TTL), Cloudflare will still rely on …


