Why heavy media breaks Git + static build pipelines
Git excels at versioning HTML, CSS, Markdown, and compact WebP UI graphics. Storing dozens of large PDFs, audio episodes, or raw MP4 video files bloats every git clone and triggers Pages file-count or per-asset limits.
Zero egress bandwidth fees matter for popular downloads
Traditional object storage charges per gigabyte downloaded every time browsers fetch media. R2 removes egress bandwidth fees cleanly while integrating directly with Cloudflare edge caching.
Attach clean custom domains + immutable cache headers
Expose a public R2 bucket via media.yourdomain.com (separate from your main HTML site origin), upload versioned filenames like /brochures/2026-menu-v2.pdf, and cache aggressively.
Common questions
Should every tiny UI icon live in R2?
No. Keep logo SVGs, stylesheets, and key WebP hero assets under ~250 KB directly in public/images/ so each Git commit keeps pages self-contained and atomic.
Can I also host private R2 downloads accessible only after payment or login?
Yes—keep the bucket private and have a Cloudflare Worker issue short-lived presigned URLs or stream verified files directly.
References
Provider interfaces and limits can change. Consult the original documentation before changing production settings.