Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDN support #545

Merged
merged 1 commit into from
Apr 5, 2023
Merged

CDN support #545

merged 1 commit into from
Apr 5, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Mar 30, 2023

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

Links

Copy link
Member

@FredKSchott FredKSchott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Read the RFC and everything you outlined makes sense to me, awesome stuff!


# Unresolved Questions

1. Is the `build.assetsPrefix` name fine? I picked it to complement the existing `build.assets` option. `build.cdnUrl` feels "sticking out".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That feels fine to me. A bit odd that it's assetsPrefix instead of Next's assetPrefix but I get that matching build.assets is probably more important.

@GrantBirki
Copy link

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.

  • Fastly
  • Cloudflare
  • Akamai
  • Cloudfront
  • Using an S3 bucket perhaps?
  • Etc

@bluwy
Copy link
Member Author

bluwy commented Apr 3, 2023

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.

@matthewp matthewp merged commit 9380c1f into main Apr 5, 2023
@matthewp matthewp deleted the cdn-support branch April 5, 2023 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants