Don't cache static files in web worker

I use web worker for serving my static files (I use a worker for Authorization before my user can access to a file)
problem is when users download a file from web worker all the subrequests count as cached and it’s using a lot of bandwidth (it’s show in Cached bandwidth in worker analytics) and I know it’s not cool with Cloudflare and I eventually gonna kick out.
is there any way to serve a file directly from my origin server?

Huh? Since when is using CF Cache not ok? :smiley:

I use free plan and it’s in their terms says using Cloudflare for caching anything non-HTML content is prohibited.

2.8 Limitation on Serving Non-HTML Content

Ah, yes, on the free plan. I’d suggest getting the 5$/mo plan, it’s not much for what you get.

1 Like

$5 plan it’s only for unlimited requests and more CPU time, it’s doesn’t have anything to do with bandwidth usage.
I think for caching static files with high bandwidth usage you have to be on Enterprise plan, I read post on this forum, a user site got banned after using a lot of bandwidth and even after upgrading to business plan his site didn’t go reopened.

It’s not a question of cached or not. If you don’t want the requests served through Cloudflare you should serve them on :grey: records.

If you’re trying to stand up a video streaming or other specialized website behind Cloudflare, you need to be on an appropriate plan. otherwise you can serve those resources direct from your origin :grey:.

1 Like

I use DNS only for my worker CNAME, it’s don’t show any Cached Bandwidth in traffic tab, but it does show it in the workers tab.

is there any difference between web traffic bandwidth usage and workers bandwidth usage?

worker.dev always go through workers, that’s the point.

If you would use a normal domain without the orange icon, then no traffic would go through Cloudflare.

you are right when I use the grey icon, all traffic from the worker is Uncached, but the worker itself still is part of Cloudflare and it does use Cloudflare traffic (we can see all those traffic in worker analytics tab).

so my question is if my worker uses a lot of bandwidth, is it gonna violate Cloudflare terms?

Yes, workers.dev are not meant for production traffic at all… I think? CF might answer this better.

Is your worker simply retrieving content from %random host% and delivering it through an :orange: record? That’s effectively having an :orange: record.

If you are say… providing the client with a manifest which has links directly to :grey: records and users retrieve content directly from that host, rather than your worker retrieving it from that host then that would generally be fine…though I don’t see how it would produce a lot of bandwidth.

And yeah… to @thomas4’s point using a workers.dev zone for production traffic or obfuscation of your own zone is probably not a good idea.

3 Likes