Awaiting Response from ajax.googleapis.com

I added jQuery to my website from Google. The terrible part is the complete slowness of the google server. Once my site crashes when trying to download jquery from googleapis:

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

Can i do something? Better to load jquery from other servers? (maybe mine?) When a “pending response from ajax.google” appears, I can wait 30 minutes and nothing happens, I need to reload the page to show it

+4
source share
5 answers

In my case, I found that it is better NOT to use an external CDN.

  • You have no control over this, Google may stop serving the jQuery version
  • When loading the page, this means 1 HTTP request to one other host (not so good, since the browser performs parallel requests)
  • In most cases, you use minifier, so you can include jQuery lib in your large file with mini files to reduce HTTP requests.

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

+9
source

I have never had a problem with this.

On a side note, you should always use the full version of jquery. eg -

 http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js 

You lose the benefits of caching if you use just 1.4 or 1.5.

Here is a pretty good article on why you should use the Google CDN:

http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/

+4
source

It is better to use Google CDN and then download from your server. Most users already have jQuery from the Google cache and do not even have to download it. Read the 3 reasons why you should use Google to download jQuery http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/

You can also try downloading jQuery from microsoft CDN in

http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js

You can also download jQuery from your server if it has not been downloaded from Google. You do this by writing

 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> <script type="text/javascript"> if (typeof jQuery == 'undefined') { document.write(unescape("%3Cscript src='/jquery-1.5.1.min.js' type='text/javascript'%3E%3C/script%3E")); } </script> 
+2
source

FWIW I had terrible boot times from chrome (2 m +) with a code base, then I found that it used:

 https://ajax.googleapis.com/... # slow 

Having disconnected from https in the corrected code, now it is lightning fast (while you are online):

 http://ajax.googleapis.com/... # fast 

Sorry, I see that you are not using https , but maybe this will help others. But on the first stream, I prefer to have control and be able to do offline development, and if you put static assets on a good CDN, this is a big part of the fly, whether you use Google or your own. But if you want something fast for others without hiring a CDN, this is how others have talked about how to rely on Google’s CDN (which may go away at some point, although not likely soon), or create your own or give your users a slower download time.

+1
source

I know some time has passed, and this is an old problem.

Similar things happened to me, and I can assure you that this is not because of google cdn. In my case, this only happens in Google Chrome, and not in Firefox or Internet Explorer (and not in IE events, you can believe it), so I decided to remove the html parts one by one and output it to space objects in html, like tons &nbsp; some, like Chrome cannot handle them correctly (trying to replace everything I think), and this causes a problem and always shows a waiting message.

Mostly, the content user used these objects to fix the layout of some data. Instead, I used a simple table and fixed my problem.

This is about a year ago, and I also sent bug reports to Google using Chrome. ok, i'm not sure if it is fixed or not.

Hope this helps someone.

0
source

Source: https://habr.com/ru/post/1344645/


All Articles