Clarification on 25 MB Limit for Cloudflare Pages: Total Build Size vs. Individual File Size

Can I use Cloudflare Pages if the final build of my site exceeds 25 MB, while the size of each individual file does not exceed 25 MB? I tried it and it works perfectly, but in your documentation on the page Products -> Pages -> Platform -> Limits -> File size, it states: "The maximum file size for a single Cloudflare Pages site asset is 25 MiB." Will using it this way result in any limitations on my account from Cloudflare? Can I continue using it if it works perfectly and there are no restrictions from Cloudflare? The final build of my site is about 70 MB. https://developers.cloudflare.com/pages/platform/limits/#file-size
Cloudflare Docs
Limits
Below are limits observed by the Cloudflare Free plan. For more details on removing these limits, refer to the Cloudflare plans page.
6 Replies
Chaika
Chaika7mo ago
The keyword there is the maximum file size for single site asset
Can I use Cloudflare Pages if the final build of my site exceeds 25 MB, while the size of each individual file does not exceed 25 MB?
Yes The max two size limits there are 20k files per deployment 25 MiB max per file
marsoleg
marsolegOP7mo ago
@Chaika thank you Marked as solved
Pascal
Pascal7mo ago
Can cloudflare please provide a guide to get around the 20k files limit? There seem to be quite a few people with this problem. It really takes away attractiveness as suddenly pages is no longer simple anymore. At this point I’m tempted to just switch to keyCDN, where I can rsync my hugo output and have as many files as I want. Is going to be cheaper than spending time figuring out workarounds and starting to write custom workers code instead of just using pages. https://www.keycdn.com/support/hugo-hosting
KeyCDN
Hugo Hosting with KeyCDN - KeyCDN Support
Learn how to setup Hugo hosting with KeyCDN and accelerate your static site globally. Check out the 4 easy integration options available.
Cyb3r-Jak3
Cyb3r-Jak37mo ago
There is no way to get around the 20k limit for Pages as it is a technical limit. In the future, please make your own post
Pascal
Pascal7mo ago
So are you saying any website with more than 20k files can’t be hosted on cloudflare? There must be some way to make it work.
Cyb3r-Jak3
Cyb3r-Jak37mo ago
You can load the files into R2 and have a worker get them from R2 but you can’t have more than 20k files. People also use server side rendering which generates the file on demand

Did you find this page helpful?