Common misconceptions about CDNs

Compare CDNsHow to use CDNs properly

You'll probably load jQuery from Cache instantly if you use a CDN

Even Google Hosted, the most popular of all the CDNs, loading the latest jQuery, you still have less than a 1% chance of hitting a users cache. It's just not that likely, there are too many versions and too many places it could be being loaded from. There are nearly 50 versions of jQuery on Google's CDN. Less than 10% of sites use Google's CDN. Less than 20% of those use the latest version. HTTP and HTTPS are separate caches. Plus, caches get cleared over time, and new versions get released.

Instead, try to focus on getting the best you can first time, and then hitting a cache your created after that.

CDNs are only for common libraries like jQuery

Not jsDelivr, or CDNJS for that matter. These two allow submission of any library (CDNJS is stricter, requiring some level of popularity). Combine that with the file-combiner found at jsDelivr, and you've got yourself one file taking care of several requests that's the same size as if they had been loaded seperately.

See How to make fewer requests.

CDNs are always available to everyone

We're looking at you, China.

Your CDN may not always be available to everyone, but seeing as you should always be able to gracefully fall back without JavaScript anyway, that shouldn't be an issue, right?

CSS loaded off of a CDN might be more difficult to fix, but if you're loading CSS, then it's probably from jsDelivr or CDNJS, and it's only Microsoft, Yahoo and Google that have been blocked in the past.