Is there any reason why Cloudflare blocks PURGE Requests.
On my server, I use Varnish For Page Cache but when I send a request.PURGE request to my site it doesn’t even reach my webserver hence Varnish never purge.
I even manually confirmed by using the following command in my PC terminal.
If I use the command with Cloudflare being paused I see the request coming to my webserver but with Cloudflare being active it doesn’t
Also, If modify the above command with a GET request it reaches my server, but a PURGE Request doesn’t.
I thought maybe my Varnish VCL is misconfigured but I even test this on a simple LAMP stack as well with no Varnish and seems that it’s not a configuration issue but an issue from Cloudflare.
I don’t have any rules in Firewall but I specifically added a rule to allow PURGE request on my domain to see if this conditions needs to be activate via Firewall Rules but still no success.
Firewall Logs were initially empty, but after I added the rule shared earlier I can only see these events which are simply logged because of the rule I added
if I disable the rule there is nothing new in it afterwards for new request screenshot below:
In this case I’d usually say the request should reach your machine. Could it be that your caching server blocks PURGE requests from Cloudflare for some reason? Double check that.
Otherwise I could only suggest that you take the connection ID from one of those “Allow” entries and open a support ticket. They might be able to tell what is happening.
Initially, I thought it could be my caching service i.e. Varnish or any misconfiguration which might not be working properly but as I mentioned earlier even after testing the domain on simple stack i.e. with Apache, MYSQL and PHP on a Linux server with no cache service I don’t see any entries in my access logs.
Anyone who wishes to replicate can use these 2 curl request in Linux environment on their domain
That’s really not good I wonder why Cloudflare does that it’s a huge drawback PURGE should be enabled because many people use server side caching like Varnish on their site, without this there will be a huge cache conflict on the sites & it doesn’t seem Cloudflare will be making this available anytime soon…
If there are some security concerns and because of that PURGE is not allowed then there shouldn’t be an option to allow/block PURGE request in firewall section as no matter what it’s blocked by default and no exceptions.