Google.com and clients1.google.com/generate_204

前端 未结 11 758
梦毁少年i
梦毁少年i 2020-12-07 16:40

I was looking into google.com\'s Net activity in firebug just because I was curious and noticed a request was returning \"204 No Content.\"

It turns out that a 204 N

相关标签:
11条回答
  • 2020-12-07 17:21

    I found this blog post which explains that it's used to record clicks. Without official word from Google it could be used any number of things.

    http://mark.koli.ch/2009/03/howto-configure-apache-to-return-a-http-204-no-content-for-ajax.html

    0 讨论(0)
  • 2020-12-07 17:25

    204 responses are sometimes used in AJAX to track clicks and page activity. In this case, the only information being passed to the server in the get request is a cookie and not specific information in request parameters, so this doesn't seem to be the case here.

    It seems that clients1.google.com is the server behind google search suggestions. When you visit http://www.google.com, the cookie is passed to http://clients1.google.com/generate_204. Perhaps this is to start up some kind of session on the server? Whatever the use, I doubt it's a very standard use.

    0 讨论(0)
  • 2020-12-07 17:27

    This documents explains:

    http://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=1417&context=ecetr&sei-redir=1

    (Search for generate204)

    Relevant section:

    Among the different objects, a javascript function triggers a generate204 request sent to the video server that is supposed to serve the video. This starts the video prefetch, which has two main goals: first, it forces the client to perform the DNS resolution of the video server name. Second, it forces the client to open a TCP connection toward the video server. Both help to speed-up the video download phase.

    In addition, the generate204 request has exactly the same format and options of the real video download request, so that the video server is eventually warned that a client will possibly download that video very soon. Note that the video server replies with a 204 No Content response, as implied by the command, and no video content is downloaded so far.

    0 讨论(0)
  • 2020-12-07 17:28

    I found this old Thread while google'ing for generate_204 as Android seems to use this to determine if the wlan is open (response 204 is received) closed (no response at all) or blocked (redirect to captive portal is present). In that case a notification is shown that a log-in to WiFi is required...enter image description here

    0 讨论(0)
  • 2020-12-07 17:31

    In the event that Chrome detects SSL connection timeouts, certificate errors, or other network issues that might be caused by a captive portal (a hotel's WiFi network, for instance), Chrome will make a cookieless request to http://www.gstatic.com/generate_204 and check the response code. If that request is redirected, Chrome will open the redirect target in a new tab on the assumption that it's a login page. Requests to the captive portal detection page are not logged.

    Source: Google Chrome Privacy Whitepaper

    0 讨论(0)
提交回复
热议问题