Avoid Worker request by cache

Hello!
Is it possible to serve a static asset from a worker to be cached so it won’t make any requests to the worker and just go straight to the static asset on the CDN? It seems to me if I cache an asset from KV it still has to go through the worker to detect cache?

Thanks!

Cloudflare is a giant Worker. And you have a worker that’s configured for a route. If that asset falls within the route, then your worker is going to be triggered. Something has to respond to that request.

What are you trying to do? Speed up the response? Not have that Worker request counted?

1 Like

Unfortunately the Workers script (and the KV GET) occur before cache, so you can’t have a worker only run once then be cached. If you set up a worker on a route, that worker will always run for that route unless this option is checked Free Tier can break your website, should we call it a Trial Tier?

Gotchya! Speed is always nice but I’m trying not to have the worker request counted.

1 Like

That’s what I thought. Thanks for the speedy response!