MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
WebPagetest Forums - Google Ajax library for serving jQuery?

WebPagetest Forums

Full Version: Google Ajax library for serving jQuery?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I read recently that cloudflare also offers a version of their cdn for jQuery called cdnjs.com -

Anybody have any experience with using these for increasing optimization?

This is a nice article on it: http://encosia.com/3-reasons-why-you-sho...y-for-you/
I used google cdn for jquery hosting (thought that most of the users will hit the file from cache),
After couple of tests, i figure out that if i will combine all the js files on my website and host the file on my webserver, it will be faster then google.

But, this is probably because google don't have cdn pop in Israel.
I pinged them from my server (London) and google was about 1ms faster, and from home (Ireland) google was three times faster. So maybe it will depend on your location as to whether it is better.
But also remember its new so not many website would be using it, so better stick with google where you get the benefit of cached libraries, until it is more widespread.
Not if you have 70% of returning visitors, and you have combined all your js files into one (cached) file.
(04-11-2012 03:11 AM)Avi Keinan Wrote: [ -> ]Not if you have 70% of returning visitors, and you have combined all your js files into one (cached) file.

Well then that has nothing to do with using a cdn for the libraries.
(04-11-2012 02:27 AM)fritzelly Wrote: [ -> ]I pinged them from my server (London) and google was about 1ms faster, and from home (Ireland) google was three times faster. So maybe it will depend on your location as to whether it is better.
But also remember its new so not many website would be using it, so better stick with google where you get the benefit of cached libraries, until it is more widespread.

It's not just the ping time is it though...

There's the time to resolve the DNS and make a new connection - I've seen a couple of cases where a site might be better serving jQuery from it's own domain rather than Google...

But a couple of samples really isn't enough to make an informed decision.
You have to treat your visitors like they are comming to your site first with a primed cache(empty)
If you really care about speed, then you will make sure to load your JS after onload.
Also, you need to remember that javascript blocks page render, so any delay in dns lookup/connect time/ttfb/or even crash (yes, google is not god, it can crash), will delay your page loading.
Reference URL's