I'm working on a blog using astro.js where my posts are primarily markdown files within the source code. A lot of these posts include media like images and videos. I prefer not to keep the media in the source code since that could really bloat it. We're currently hosting on Cloudflare Pages, so I'm looking for the best way to handle all this media.
1 Answer
It's best not to store media files directly in your source code as it can bloat your repository and make scaling harder. Since you're using Cloudflare Pages, I recommend using Cloudflare R2, which is an S3-compatible object storage solution. You can upload your images and videos there, organize them properly, and serve them through Cloudflare’s CDN for quicker delivery. Just link to the media in your markdown files with full URLs. This keeps everything tidy and efficient for your blog, especially as it grows.
I don’t get why everyone stresses about scalability for small projects. Can’t you just use a cheap VPS with Cloudflare? Seems easier to me.