guptahanu / google-ajax-apis

Automatically exported from code.google.com/p/google-ajax-apis
0 stars 1 forks source link

Loading the Search API v1 makes an additional HTTP request to host server #420

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
As of the past few days, it seems that simply calling google.load("search", 
"1") issues an extra HTTP request to the server hosting the page containing 
the script / script reference. The request pattern exactly follows the 
behavior described in this post 
<http://www.nczonline.net/blog/2010/03/16/empty-string-urls-in-html-a-
followup/>, so it seems that the Search API is setting the src property of 
an Image object to an empty value.

To see this bug in action, fire up Fiddler2 or Charles or whatever and 
take a look at the requests for this page when using Chrome, Safari, 
or IE: <http://www.fatkidproductions.com/goog-ajax-search-api/broken.html>. 
Now take a look at the requests for this page: 
<http://www.fatkidproductions.com/goog-ajax-search-api/working.html>. If you 
view source on those pages, you'll see that the only difference is that the 
google.load call is commented out.

Please take a look at this screenshot to see proof of these duplicate 
requests: <http://www.fatkidproductions.com/goog-ajax-search-api/requests-
screenshot.png>. The screenshot was taken with IE requesting broken.html and 
working.html. Requests 1 - 4 are for broken.html; requests 15 - 16 are 
for working.html. 

This bug is essentially doubling the traffic to all sites using this API, 
and as such, I believe it should be considered a high-priority item to fix.

ref: http://groups.google.com/group/google-ajax-search-
api/browse_thread/thread/5d6fdc377e1b7d88?hl=en

Original issue reported on code.google.com by amat...@gmail.com on 27 Mar 2010 at 3:14

GoogleCodeExporter commented 8 years ago

Original comment by jscud.w...@gmail.com on 29 Mar 2010 at 10:31

GoogleCodeExporter commented 8 years ago
Issue 421 has been merged into this issue.

Original comment by jrgeer...@gmail.com on 31 Mar 2010 at 11:19

GoogleCodeExporter commented 8 years ago
Either that or the header content type declaration for javascript has not been 
added 
to one of the scripts that is being called by google.load but webkit certainly 
does 
not like <img src=""> and <img> instead apparently works if an empty image tag 
is 
required.
This bug increases my site's load times by about a third in Chrome and I agree 
also 
that it is a high priority item if number three is true :
http://www.google.co.uk/corporate/tenthings.html

Original comment by tonywhit...@googlemail.com on 31 Mar 2010 at 9:22

GoogleCodeExporter commented 8 years ago

Original comment by jscud.w...@gmail.com on 1 Apr 2010 at 6:12

GoogleCodeExporter commented 8 years ago
OK. Confirmed as fixed but there is a stats gif image which is 0 bytes in size 
taking 
over 10 seconds to load into the dom. It more than doubles even pages with 
heavy 
content's load times.

Original comment by tonywhit...@googlemail.com on 1 Apr 2010 at 12:09