7

What percentage of browsers would probably have Google's cached version of JQuery already loaded?

I am asking this to figure out how fast my page would load on an "average" browser. My page needs both JQuery and JQuery UI. I believe most browsers would probably have JQuery already cached from Google's servers. Is this true? And what are the numbers for JQuery UI?

Any proof of your claim would be helpful.

Also, for Jquery UI: What components does Google's Jquery UI have? Does it have all of them or just a few (sortable, etc...)?

Also, I think it's about 180 kb. Should I use that or should I create a custom.ui.min at jqueryui.com that might be smaller?

Community
  • 1
  • 1
chris
  • 20,791
  • 29
  • 77
  • 90

3 Answers3

2

According to Best Practices for Speeding Up Your Web Site:

Reducing the number of HTTP requests in your page is the place to start. This is the most important guideline for improving performance for first time visitors. As described in Tenni Theurer's blog post Browser Cache Usage - Exposed!, 40-60% of daily visitors to your site come in with an empty cache. Making your page fast for these first time visitors is key to a better user experience.

This is relevant because for 40-60% of your daily visitors, it doesn't matter where you load the jQuery library from, they won't have it in their cache.

I also think there is more to the question then how often your visitors will have it cached. Do you want to take a dependency on an outside company you do not control, even one as large as Google? What if Google is down (it has happened)? What if Google suddenly decides to stop hosting jQuery while you are on an extended vacation? What if a Google employee makes a mistake and overwrites your specified version with a new version of jQuery that breaks functionality on your page?

Grant Wagner
  • 25,263
  • 7
  • 54
  • 64
  • 1
    Most of the concerns you bring up about google hosting can be solved with the simple implementation found in this thread: http://stackoverflow.com/questions/1014203/best-way-to-use-googles-hosted-jquery-but-fall-back-to-my-hosted-library-on-goo – zombat Aug 19 '09 at 22:37
  • @Grant: that's a surprising large number. thanks for the info – chris Aug 19 '09 at 23:20
  • 7
    This is not accurate. 40-60% of users will not have resources from your site cached, but the Google API cache is different. The Google jQuery URL remains cached in the browser for one year (or until cleared). Many users will have jQuery cached, even if they've never seen your site before. – Matthew Apr 23 '10 at 18:10
  • 4
    As said above this is very misleading. The test conducted by yahoo was: "users’ cache behavior related to a new component (an image)" which obviously is no where near comparable to the percentage of browsers that will have jquery from the google cdn. – Zaptree May 19 '12 at 22:16
  • 3
    yes very misleading. I would guess as high as 90% or even more already have google jquery libs cached. A more interesting study woudl be to see which versions people have cached. – Brady Moritz Nov 29 '12 at 23:51
2

The only stats I've seen are ones from the research pingdom did in June last year.

It's difficult to extrapolate from that the percentage of browsers with a cached copy - it will probably vary considerably based on audience. For instance, stackoverflow uses Google's CDN, so 99.99%* of developers will have a cached copy of (currently) jquery 1.7.1 :).

*statistic made up on the spot

Sam
  • 4,694
  • 2
  • 36
  • 47
-4

I'm not sure anyone could answer that. But more importantly: does it matter? It loads once and that's it (well, until a new jQuery version is released depending on what URL you use).

I'm not sure I understand the relevance of such a statistic in that context.

cletus
  • 616,129
  • 168
  • 910
  • 942