Search code examples
google-chromehttpprotocolsmime-types

What is text/ping and is this a new standard? Is it browser dependent?


I was troubleshooting something on Google and saw this request from the browser to the Google servers. It was non-blocking. Is this something new? Where is the documentation for it? Does it depend on Chrome to not wait for a response?

Request URL:https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&docid=dhjbxjwb-Rlp3M&tbnid=cz8pdopQeaKouM:&ved=0CAIQjBw&url=http%3A%2F%2Fexample.com%2Fwp-content%2Fuploads%2F2014%2F06%2F2015-Jeep-Renegade-Example.jpg&ei=yKXTU7qeJJSpyATJ1oCYDw&bvm=bv.71778758,d.aWw&psig=AFQjCNGvbBFVDoY6iwA_ITNaSamSvq0aYg&ust=1406465471788003

Request Headers
Provisional headers are shown
Content-Type:text/ping
Origin:https://www.google.com
Ping-From:https://www.google.com/search?q=site:example.com&tbm=isch&ei=C6HTU9j7EI6pyASBsYDgDw#facrc=_&imgdii=_&imgrc=cz8pdopQeaKouM%253A%3Bdhjbxjwb-Rlp3M%3Bhttp%253A%252F%252Fexample.com%252Fwp-content%252Fuploads%252F2014%252F06%252F2015-Jeep-Renegade-Example.jpg%3Bhttp%253A%252F%252Fpixycars.com%252F2015-jeep-renegade-example-example-example%252Fjeep-renegade-2015-example%252F%3B2048%3B1360
Ping-To:http://example.com/wp-content/uploads/2014/06/2015-Jeep-Renegade-Example.jpg

Request Payload
PING

This was the only documentation that I could find, but it says it is still in review: http://www.whatwg.org/specs/web-apps/current-work/multipage/iana.html#text/ping

Notice the timeline doesn't want for the response from the first request.

Imgur


Solution

  • It's for hyperlink auditing[1]. It's a shout-out the browser gives if a link is followed.

    The documentation states:

    The ping attribute is redundant with pre-existing technologies like HTTP redirects and JavaScript in allowing Web pages to track which off-site links are most popular or allowing advertisers to track click-through rates.

    However, the ping attribute provides these advantages to the user over those alternatives:

    It allows the user to see the final target URL unobscured.
    It allows the UA to inform the user about the out-of-band notifications.
    It allows the paranoid user to disable the notifications without losing the underlying link functionality.
    It allows the UA to optimize the use of available network bandwidth so that the target page loads faster.
    Thus, while it is possible to track users without this feature, authors are encouraged to use the ping attribute so that the user agent can make the user experience more transparent.