Is it foolish to load Ember from a CDN?


#1

I was wondering why only very few people are using a CDN for loading Ember within an app. Why doesn’t EVERYBODY simply load Ember from the same URL? This would increase the performance of all of our apps significantly because all browsers keep a cached copy of Ember on the disk.

Why is nobody doing it like that? Or am I just missing something here?


#2

Ember Twiddle loads Ember from a CDN.

I think someone needs to write an addon to do this. :wink:


#3

It’s kind of unnecessary since part of the Ember CLI build process is to combine all of your JS files into just two JS files so loading Ember as a separate file isn’t really required/expected.

Other reasons not to use a CDN:

  • It’s another thing that can fail and is out of your control
  • Ember isn’t widespread enough that the actual “hit rate” would be that high and the frequent update cycle means any benefit would be short-lived and potentially complex to manage
  • If you use a 3rd party CDN then you may need to include that in contracts with customers

#4

I also think there are simply too many Ember versions around and coupled with the low market share of Ember in general, this might make it a much less compelling alternative than it is, say, for jQuery or lodash.


#5

Those are great points, thank you! I’ve decided to let ember-cli handle all of that stuff and not use a CDN.


#6

We are loading Ember & Ember Data from cdnjs right now.

We release updates to our app daily (but only upgrade Ember monthly), so our users should be seeing some cache value.


#7

Ahh, interesting! But honestly, I was talking about one CDN for all developers around the globe, not just for one app. :smile:


#8

cdnjs is for all developers :stuck_out_tongue:

Seriously though, it doesn’t seem like CDN is a popular choice for Ember right now, but it works for us, so I wanted to mention it.