Topic:
CDNs and other optimization techniques. This comes up a lot, it crosses numerous mailing lists and twitter. If you have thoughts on this, let's discuss and we can easily cite/refernce in the future....
Here is a statement from @scott_gonzales on twitter, and some thoughts from me to open the discussion
Scott: CDNs have much higher cache-miss rates than you'd think, and JS should be concatenated and deployed from the server
Me: It's true cache-misses are higher, but I don't want to throw the baby out with the bathwater. The advantages of concat will largely disappear with HTTP2. CDNs have a number of things (some in theory and some in practice) which seem good. At an incredibly utilitarian level, if I can offload that from my own infrastructure and maybe reduce hops for this requests too - seems good. At a more conceptual level, the idea that some resources are highly shareble and deserve a special home/cache seems good even if CDNs don't currently fully enable that - seems maybe not so much a problem with the CDN as much as one for the platform to help tackle. It does seem ridiculous to send signficant capabilities like jQuery, Ember or Angular down over and over and ask them to eat up cache space in my own domain. It really seems like there should be 1 and only 1 version of content called jQuery-x.y.z.js
@yoavweiss hit a lot of network technical reasons that 3rd party CDNs aren't always great. Unfortunately, the cache HIT rate is much lower than you'd expect, even for something as popular as jQuery. This is a mixture of so many versions being popular, so many different CDNs being popular, and of course the user's actual cache.
However, another issue that often comes us is that you may end up pulling down much more code than you actually need. For example, CDNs have become so popular that it's basically the go-to choice for many devs. Which means that when someone wants just a datepicker or just tabs or just a dialog from jQuery UI, they grab it from a CDN and now they've got dozens of plugins they're not using, which is killing them on a cache MISS (and even on a cache HIT with all the extra parsing).