Cloudflare Cache Not Caching

Hello there, good day! I'm wondering If I'm doing something wrong, I've a worker site that returns assets from A storage bucket with the cache flag like this:
const fetchBucketContent = async (path: string, bucket: string): Promise<Response> => {
return fetch(`https://${bucket}${path}`, {
cf: {
cacheEverything: true
}
})
}
const fetchBucketContent = async (path: string, bucket: string): Promise<Response> => {
return fetch(`https://${bucket}${path}`, {
cf: {
cacheEverything: true
}
})
}
However, when I look at the cloudflare analytics, this is the percentage of cahing I'm getting: I was testing my site with Webpagetest and GT Metrics multiple times, I want webpagetest and GTMetrics to receive the cahced content and not the worker content. How would I go about that?
1 Reply
lmtr0
lmtr014mo ago
Something to note is that WebPageTest uses the Cache-Control: no-cache on their end, but I don't see why that would be a problem Answer: Use the cacheTtl