We configured ‘cache everything’ for our website so the main HTML is served from CF’s cache.
The problem is, every time we purge the cache, every visitor that hits our website causes CF to reach our servers.
Since we have very heavy traffic, these thousands of calls make the server incapable to serve any requests for a few minutes.
I would expect CF to reach once for the content, and serve it to everyone else once it gets it. Worth mentioning these are obviously the same URL.
Is there any way to achieve this? Or any better solution to handle this problem?
This static content is being updated 2-3 times a day, so purging the cache every few hours is something we must do.
Only through the same exact edge server. With over 250 data centers, your visitors might be in different locations. Even from one location, it takes me a few requests before I get a HIT consistently for a specific URL.
A halfway decent server shouldn’t even break a sweat even for thousands of calls per minute for static content. Even if it’s somewhat dynamic, server side caching would help.
As far as Cloudflare settings, Tiered Caching should help:
To add, have you tried only purging the cache of the pages you’ve updated? If you’re using Wordpress, the plugin has Automatic Cache Management, and if you’re not using Wordpress, you could see if you could integrate the API to purge resources, otherwise the ‘purge URL’ in the Cloudflare dashboard also works.
It’s not a WP site, but I see all the server calls and the problem is this one single URL - the homepage.
So purging this specific URL won’t have any effect probably, as this is the only URL that causes problems to begin with.