HACKER Q&A
📣 brundolf

Cloudflare for Hosting Code Files?


I'm interested in using Cloudflare to serve up some code modules for others to download. I'm having some difficulty figuring out which product I should be looking at; I'm not even 100% sure that Cloudflare is where I should be looking in the first place:

- R2 is supposed to be their version of S3. But the materials are focused on storing large blobs, etc, which sounds like it might be overkill. I also would want my resources to end up on a CDN, and I don't know if R2 is the route you're supposed to take for that.

- Pages: obviously intended for serving a static site, but I'm wondering if it could be used/would make sense to use for smallish non-web text files

- Cloudflare CDN: it's hard to tell whether this is something you use directly, or whether it gets layered on top of other things like Pages and R2. It has some sort of API, but I couldn't find anything in the docs about how to "just upload a file".

This isn't really my area so any help is appreciated. Just want to serve up some files, distribute them via CDN, and occasionally push up new ones from CI.


  👤 MaknMoreGtnLess Accepted Answer ✓
Store on R2 and serve off Cloudflare CDN by allowing it to read off R2

So you interact with R2 Your users interact with Cloudflare CDN