WebPagetest Forums
jquery from google or from your domain ? - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Optimization Discussions (/forumdisplay.php?fid=5)
+--- Thread: jquery from google or from your domain ? (/showthread.php?tid=903)



jquery from google or from your domain ? - piratos - 07-04-2011 08:04 PM

Look at this results to find the answer.
German hosted domain, tested in Dulles.

IE9 jquery from own domain

http://www.webpagetest.org/result/110704_28_ZJAK/

IE9 jquery from Google

http://www.webpagetest.org/result/110704_KZ_ZJB6/

Chrome jquery from own domain

http://www.webpagetest.org/result/110704_E2_ZJ9P/


Chrome jquery from Google

http://www.webpagetest.org/result/110704_Q2_ZJA4/


RE: jquery from google or from your domain ? - John Clegg - 07-05-2011 11:57 AM

Interesting results.

Note: Your test contain some errors . http://www.webpagetest.org/result/110704_Q2_ZJA4/ is slower because of a slow DNS query to your site, NOT the google host. You should repeat the test.


RE: jquery from google or from your domain ? - pmeenan - 07-07-2011 03:41 AM

Also try the http version of the Google ajax-api's hosting instead of https.

Generally it will be more expensive to fetch from a 3rd party because it has to do an extra DNS lookup. There are some benefits that can help mitigate that impact (Google's CDN could have lower latencies to your users, reduces your bandwidth costs and higher liklihood that users will have the shared version cached already) but if you are only serving users locally then odds are that it will be faster to serve the content yourself from the same domain as your page.


RE: jquery from google or from your domain ? - namon96 - 08-18-2011 05:20 AM

(07-07-2011 03:41 AM)pmeenan Wrote:  Also try the http version of the Google ajax-api's hosting instead of https.

Generally it will be more expensive to fetch from a 3rd party because it has to do an extra DNS lookup. There are some benefits that can help mitigate that impact (Google's CDN could have lower latencies to your users, reduces your bandwidth costs and higher liklihood that users will have the shared version cached already) but if you are only serving users locally then odds are that it will be faster to serve the content yourself from the same domain as your page.

Hi Patrick,

What about the theory that its likely someone visiting your site is likely to allready have the google code sitting in their cache.

cheers
Norman


RE: jquery from google or from your domain ? - pmeenan - 08-23-2011 06:41 AM

There are varying opinions on that theory. With the number of different versions of each library there is an argument that the chance of a specific version being in the user's cache is not as high as you might hope. If you are using the same version as a LOT of other sites then the liklihood goes up though.