2

I'm trying to optimize my website and running a few tests using webpagetest.org. I tried the test from Singapore and Hongkong.

I saw that while all facebook, quantcast, chitika scripts were loading from singapore/hongkong servers, but jquery (google hosted), plusone.js, twitter etc were loading from the mountain view/palo alto/cambridge servers.

Since I'm using cloudflare, I can see that one of the JS files that I host on my server was actually loading from one of cloudfare's singapore servers.

So is there a real benifit of using google hosted jquery etc?

Sample test results are here

1) For my website's home page (http://www.humbug.in) - Test Location Singapore

http://www.webpagetest.org/result/110904_89_1G8RF/1/details/

2) For the url of this question - Test Location Amsterdam

http://www.webpagetest.org/result/110904_B6_1G93M/1/details/

In both cases jquery is being loaded from mountain view servers

2 Answers 2

5

In both cases jquery is being loaded from mountain view servers

I don't think this is true.

As you said, ajax.googleapis.com is 'located' in Mountain View (according to Geo tools). This server is responding (ping) in 24 ms (my location: Switzerland), but with speed of light it actually needs 68 ms. So I don't get routed to Mountain View at all, since nothing is faster than light.

When I'm requesting ajax.googleapis.com, a Server close to my location is responding. So Google's CDN is working as expected.

5
  • so when it shows, Mountain View, its just the geolocation of the server according to its ip and not where the file's actually being served from? Why do the other server's show singapore/hongkong as their geolocation while their ip's geolocation is also somewhere in the US? Sep 4, 2011 at 10:55
  • also is twitter's case same as ajax.googleapi's? Sep 4, 2011 at 10:56
  • I guess it depends on the geo tools, which country is shown, or where the IPs are registered. Not sure about this. When I resolve the IP of platform.twitter.com I don't get the same IP as some online tools. So it depends on your location which (physical) server the files are served from.
    – Floern
    Sep 4, 2011 at 11:20
  • I believe this answer is correct. The tool is most likely just showing you the domain registration information for ajax.googleapis.com or the ARIN registration information for the owner of the IP block. A better measure would be running a traceroute to the CDN address from multiple locations.
    – Dave Ward
    Sep 4, 2011 at 15:10
  • Geo tools only locate where the last IP block is registered a lot of the time. So, when you do a GeoIP on my address, your GeoIP reported location is about 260 miles or 140 miles from actual location, depending on which IP I answer from. Google's server network using IP's registered to Mountain View, CA can be located anywhere on the planet. If they let you, doing a traceroute may give you more valid information on location than GeoIP. Sep 4, 2011 at 21:55
2

Yes, there are benefits. Excerpts from 3 reasons why you should let Google host jQuery for you:

Better caching

Potentially the greatest benefit of using the Google AJAX Libraries CDN is that your users may not need to download jQuery at all........Even if someone visits hundreds of sites using the same Google hosted version of jQuery, they will only need download it once!

Decreased Latency

A CDN — short for Content Delivery Network — distributes your static content across servers in various, diverse physical locations. When a user’s browser resolves the URL for these files, their download will automatically target the closest available server in the network.

Increased parallelism

To avoid needlessly overloading servers, browsers limit the number of connections that can be made simultaneously. Depending on which browser, this limit may be as low as two connections per hostname.

Intentionally splitting web page resources across multiple domains to make pages load faster is called domain sharding. Doing this allows more resources to be downloaded in parallel, reducing the overall page load time. Most of the U.S. top ten web sites do domain sharding.

1
  • not sure if your read my question, its the CDN part which doesn't seem to be working, look at the results. Jquery is being fetched from US servers, when I'm running the tests in Asia and Europe Sep 4, 2011 at 6:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.