How to use CloudFront or any other CDN with a meteor application.

I do not have a good document for using CDN with meteor application. Can anyone lead me to a meteorite CDN?

Thank you hare

+5
source share
1 answer

I detailed how we did this at Edthena in this post . TL; DR:

Add this line somewhere in your server code:

WebAppInternals.setBundledJsCssPrefix(CDN_URL); 

Where CDN_URL is your CloudFront URL (e.g. https://a27n0s89ik4xb3.cloudfront.net ).

We kept the default values ​​when creating the CloudFront distribution, except for the following:

 Origin Domain Name: myapp.example.com Origin ID: myapp.example.com Viewer Protocol Policy: HTTPS Only Compress Objects Automatically: yes 

If you serve your own fonts, you may get cross-origin errors (if you don't use the font data URL). Josh Owens describes how to handle this in his post .

+1
source

All Articles