withastro / roadmap

Ideas, suggestions, and formal RFC proposals for the Astro project.
292 stars 29 forks source link

CDN support #545

Closed bluwy closed 1 year ago

bluwy commented 1 year ago

This RFC adds CDN support through the build.assetsPrefix option. Allowing sites to fetch all assets from an external CDN.

Links

GrantBirki commented 1 year ago

This looks awesome! I think it would be a massive win to serve assets from a CDN for larger projects using Astro.

The only thing I would add is perhaps some sort of section that outlines a checklist of all major CDNs that will be tested to ensure they work with this newly purposed feature.

bluwy commented 1 year ago

Tested with Cloudflare and it seems to work: https://github.com/bluwy/astro-cdn-test and https://bluwy.github.io/astro-cdn-test/. The core workings is the same so I'd expect it to work in other platforms too as long as the links are correct.