Hacker News new | ask | show | jobs
by lokl 1731 days ago
Can you use R2 to host a static website as easily as you can with S3?
3 comments

To host static websites, you use Cloudflare Pages.
Cloudflare Pages locks you into git-based deployment, which isn't always practical, especially for sites that are heavy with images and other non-text static assets. I don't want to use git to manage the images for my website and I don't want to have to pay Github every month for Git LFS storage and bandwidth costs.
You can take a look at Workers Sites instead. Similar to their Pages solution, but with a lot more flexibility.
Thanks, I am familiar with Pages, but I would like to know whether R2 can also be used for this purpose, in a similar fashion as S3.
Indeed, the Browser -> CDN -> Object storage static hosting model all under one roof is extremely appealing.
Sure, you could just setup a Worker in front of a bucket. This is very similar to how the original Workers Sites worked.
This (combined with the free egress) would be an utterly killer app for sites that just want to publish a few simple static files.