Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which jQuery version to reference for CDN?

Tags:

jquery

cdn

I want to use Google's jQuery CDN so that the user has the best chance to already have a cached version of jQuery.

Now my question is, how do I determine what is the best version of jQuery to maximize the probability that the user already has a cached version?

Should I reference the latest version of jQuery? Or the most popular version?

For example, the latest version is currently jQuery 1.9.0, which was just released yesterday. But most sites probably are not referencing it yet, so I would be better off using 1.8.3?

I'm thinking that I could just look at the source code for Google or other popular websites and see which jQuery they're referencing, but I can't seem to find any reference to jQuery when I view the source.

like image 342
wisbucky Avatar asked Jan 16 '13 10:01

wisbucky


People also ask

What is the best CDN for jQuery?

If you don't need HTTPS support, the fastest CDN is actually the official jQuery CDN, provided by Media Temple. Google's Libraries API CDN is a good second choice after that. If you need support for HTTPS, your best option is Google's Libraries API CDN.

Which CDN is used in jQuery?

A jQuery CDN has two types: traditional pull jQuery UI CDN and reverse proxy jQuery UI CDN.

Should I use CDN for jQuery?

There are a lot of people that say you should always use a CDN for libraries like jQuery (and other popular projects, as well). They say this for good reason. Using a CDN, as noted already, can reduce latency and allow browsers to cache a common file so it doesn't even have to load it from a server.

What is Google CDN jQuery?

Projects In JavaScript & JQueryGoogle provides CDN support for jQuery via the googleapis.com domain. The latest version of Google CDN provides four different types of jQuery versions- normal (uncompressed), minified, slim, and slim & minified. Google CDN provides the jQuery via ajax.googleapis.com domain.


1 Answers

I would use the most recent release after giving it a thorough test on your site.

Any performance gain you would get today by using an older release will be lost in a short time as other sites move up to the new release.

Looking at other sites isn't very helpful, I just tried a few. The releases are all over the place, Google, Twitter and Facebook don't appear to use jQuery (at least not by name) and stackoverflow is using 1.7.1

like image 150
Peter Wooster Avatar answered Sep 19 '22 13:09

Peter Wooster