Does Rate Limiting apply to Workers?

I plan to use Cloudflare Workers to serve dynamic web pages to my users at the edge directly. If the user is anonymous, they will receive a cached version of the HTML page (assuming it is a public page). If they are authenticated then they will receive a dynamic version of the page with information relevant to their account included. In the second case, the page is being served from the Worker itself, so it is not being sent from any origin.

I need a way to rate limit these requests based on the user’s IP so that slow and low HTTP requests made to the Worker don’t drastically increase my bill. It seems like using Cloudflare’s Rate Limiting feature would be perfect for this scenario.

But when comparing the features of Cloudflare’s plans (I would be using the Pro plan), I see that the “Allow Edge Traffic to Count” feature is only available for Enterprise customers.

So does this mean that Worker requests can’t be rate limited? If this is the case, is there any other way to limit requests made to the Worker? For example, only allowing 100 requests/min from the same IP address?

Thank you.

The firewall rules are applied before the worker is executed, so yes, the rate-limits apply to workers.


Great to know, thanks for the response!

1 Like