How does Cloudflare CDN handle files in users POST request?

Hello! I’m kinda new here. So I’m trying to figure out:
What is actually happening when user sends a POST request with some file to my web app, which is cached in Cloudflare CDN?

I’ve found some information in Cloudflare’s “About” page section " Customization options and limitations". It only contains “Cloudflare limits the upload size (HTTP POST request size) per plan type:” and next I see listing options.

But so, what is actually happening?
Does CloudflareCDN somehow cache user files and deliver via it’s network, or just redirects the request to my web service directly? How does this process work?

Please, help me to understand this case.

Evan Vilagov,
Junior Software Developer.

Cloudflare can’t cache handling, there would be no way for them to store that kind of thing. They cache responses, so an image, CSS, JS, HTML page or what have you (things that get sent to the user). The POST is something that would go to your server (after still being proxied for security and things). It is still up to your app to handle that.


Thank you for your answer!

Ok, got it. So does the only reason for files size limitation in POST request consist in some security stuff?

(in after still being proxied for security and things)

POSTs can require significant resources to proxy and handle, and there are lots of ways to abuse them, especially when POSTing very large objects. Limiting their size by plan type limits the potential impact of abuse. POSTs are generally uncachable, so each post and it’s body will be sent to the origin, so can create unnecessary load on the origin.

In my own case, I’d actually like the ability to have a much lower limit than the current options, as my sites will never see a 100Mb post, let alone a 500Mb one. Anything over about 1Mb is essentially an attack, and can safely be dropped. But I also use the WAF to create a allowlist for POST method URLs, and block any unused HTTP methods (anything other than GET, HEAD, POST and OPTIONS)



This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.