How Workers affect Caching and Page Rules

Hello,
Recently I started Using Workers to modify requests to my origin and It’s working perfectly.
Since I started Using It in the free plan as a testing phase I see a lot of unusual Cache behavior.
Can anyone please help me to understand how Workers Cached, how to control that cache if applicable and How it’s affecting Page rule set to cache specific folder for example.
Thanks.

That’s not much information to go on. I use many types of Workers. Some interact with caching, and others affect it at all.

What unusual cache behavior are you seeing?

What does your Worker do?

Hello,
Thank you for your reply.
1-The worker is based on this topic to block all request that is not coming from Cloudflare to my origin.

2-I’m using a single folder for all Images at my site and created page rule to cache it all for a month at Cloudflare. Recently the percentage of cached content dropped dramatically to zero sometimes I’m a little bit confused is this means that the worker modifying something’s in the cache or the bad requests that I want to block originally Started to go through Cloudflare and targeting unchanged content or I missed something. Plus the worker Itself how I control its cache.
Thanks again.

I’ll let @cbrandt give this a go, as it’s his post.

1 Like

Hi @eng.a7medfouad,

The worker to prevent direct access has not connection with caching. I have no idea what’s at play in your configuration, but that worker isn’t involved in the least in caching or cache control.

What normally results in near-zero caching levels is the use of Purge Everything or an attack where many random URLs are requested from your website. Your origin server access logs is your best friend here.

There’s no cache involved in the worker. It only creates a header that is sent from the edge to the origin, with no impact on caching in any way.

1 Like

@cbrandt
Thank you very much for the help I will Check my log files for any abnormal activities.

1 Like

This topic was automatically closed after 31 days. New replies are no longer allowed.