Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Waiting reply from ajax.googleapis.com

Tags:

jquery

I have added jQuery to my webiste from google. The awful part is the completly slowness of google server. Sometime my website stops while trying to loading jquery from googleapis:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>

Can i do something? It's better to load jquery from other servers ? (maybe mine?) When the "waiting reply from ajax.google" appears i can stay 30min waiting and nothing happens, I have to reload the page to show it

like image 291
dynamic Avatar asked Mar 21 '11 17:03

dynamic


1 Answers

In my case, I found its better to NOT use external CDN.

  1. You don't have power over it, Google can stop serving a version of jQuery
  2. On page load, it means 1 HTTP request to 1 different host (not good since browser does parallel queries)
  3. Most of the time you use a minifier so you can include the jQuery lib in your big minified file to reduce HTTP requests

And I found that Google CDN is very slow... I constantly get "Waiting for ajax.google....."

like image 147
Thomas Decaux Avatar answered Oct 14 '22 15:10

Thomas Decaux