Worker has custom domain but is not being cached

I have a worker that is hooked up to a custom domain. The domain has an A record added to route all subdomains to the worker.

There are two issues with this setup:

  1. The site it not being cached.
  2. Subdomains are not being routed (e.g. times out).

Here’s the DNS:

And here’s the setting showing the domain hooked up to the worker:

Can you share your worker code? How are you interacting with the Cache API?

Workers run before Cloudflare’s cache. You can interact with the cache using the Cache API, but you cannot cache the response returned by the Worker.

That makes sense. My worker is calling another, which is noy cached (no custom domain), so that’ll be why.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.