putyourlightson / craft-blitz

Intelligent static page caching for creating lightning-fast sites with Craft CMS.
https://putyourlightson.com/plugins/blitz
Other
149 stars 36 forks source link

Allow caching of non-GET requests #392

Closed nickdunn closed 2 years ago

nickdunn commented 2 years ago

I recently had a site suffer from a malicious attack whereby a bot was sending a large number of POST requests to the site. Blitz ignores these as un-cacheable, which meant the server was brought to its knees pretty quickly. Is there any trick to allowing Blitz to cache non-GET requests too?

Edit: should be a question or feature request, not a bug.

bencroker commented 2 years ago

A POST request is generally a request to the server to take some action, so it makes no sense to cache it. POST requests are also protected from CSRF in Craft, so there is extra security attached to them. It sounds like you are asking about DDoS protection, which Blitz does not provide. For that I'd recommend looking into Cloudflare or the numerous other solutions out there.