Hare Ram
Hare Ram

Reputation: 783

how to use CloudFront or any other CDN with meteor application.

I am not getting any good document for using CDN with meteor application. Anyone can guide me to CDN with meteor application ?

Thanks, hare

Upvotes: 5

Views: 685

Answers (1)

David Weldon
David Weldon

Reputation: 64312

I've detailed how we accomplished this at Edthena in this post. The TLDR is:

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 defaults 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 can end up with cross origin errors (unless you use a font data URL). Josh Owens describes how to deal with that in his post.

Upvotes: 1

Related Questions