Fetch() cache behaviour
With the following, the
Response
's cf-cache-status
header is BYPASS
. I was expecting to see cache headers for the specified time instead. url
is a URL to a third-party API. I have a change to the data on the third party service, triggered the worker within seconds, and I saw the change immediately - I was expecting it to stay cached. I need to verify how to cache these, as it's implied in the docs it should work.
In case it matters, I am on a paid worker plan. I am using a workers.dev subdomain.
The related website in the account is on the Free plan (I am not using it for a custom domain/route for the worker).
I am testing this via Wrangler.4 Replies
workers.dev doesn’t have caching. You need to use a custom domain
Thank you - I'll use a custom domain. Then this should work?
Once on a custom domains, are the minimum TTLS for this per the Edge Cache TTL table on https://developers.cloudflare.com/cache/about/edge-browser-cache-ttl ?
Yeah, that should apply there
You might be able to bypass it by invoking the Cache API manually, and using cache headers
Thank you very much ❤️