W3C home > Mailing lists > Public > public-web-perf@w3.org > October 2013

RE: [Beacon] spec feedback + few suggestions

From: Jatinder Mann <jmann@microsoft.com>
Date: Wed, 30 Oct 2013 18:36:32 +0000
To: Chase Douglas <chase@newrelic.com>, Ilya Grigorik <igrigorik@google.com>
CC: public-web-perf <public-web-perf@w3.org>, Jonas Sicking <jonas@sicking.cc>
Message-ID: <7cdbb79e8b994a318c86e4999078f805@BLUPR03MB065.namprd03.prod.outlook.com>
Thanks Ilya and Jonas for reviewing the spec and putting together this feedback. It would be great if we can discuss the feedback on the mailing list directly to get more visibility.

> // Move from window.beacon() to navigator.sendBeacon(), or something similar
> // to reduce chance of collision with existing user code.

I have actually heard feedback that the "beacon" name isn't very clear, and there maybe conflicts with existing "beacons". What do you think about AsyncSend()? It captures the intention of the API well.

Looks like navigator is mostly used to share data on the user agent's state. To reduce conflicts, we can move the AsyncSend/beacon method under the Performance interface? That has the added benefit of implying the method as a performance feature.

I can move the url parameter to be the first argument and set "GET" as the default verb.

> Beacons are fire and forget
I like the feedback that the beacon should be sent at earliest opportunity, but the UA can choose to defer it if required to conserve power. I will update the spec.

> If the UA has successfully dispatched beacon HTTP request, then it is marked as successful regardless of server return code
I'll make sure the spec call this out.

The current spec states that the beacon is an "interoperable means for site developers to asynchronously transfer data from the user agent to a web server, with the user agent taking the responsibility to eventually send the data." This may be confusing as it can be interpreted to mean that we will re-send multiple times. I think we should change the "responsibility" to instead "best effort". The spec should probably also call out that if the browser session is ended before the beacon is sent, we will not try again.

> In order to keep things simple we could apply the same limitations for same-origin requests as we have for cross-origin requests.
I can understand that we should limit cross-origin verbs to {POST, GET}, but I don't think we should limit same origin to not use PUT.

> Beacon API should limit size of send payload to <TBD> KB
I agree that we should add a limit. I've heard feedback where some folks were hoping to use this API to do large background uploads. Adding a limit would prevent this kind of abuse of the API. What is a decent limit?


From: Chase Douglas [mailto:chase@newrelic.com]
Sent: Wednesday, October 30, 2013 10:40 AM
To: Ilya Grigorik
Cc: public-web-perf; Jonas Sicking
Subject: Re: [Beacon] spec feedback + few suggestions

I made some comments in the doc itself. Is this alright, or should we be sending all comments to the list?


On Wed, Oct 30, 2013 at 10:27 AM, Ilya Grigorik <igrigorik@google.com<mailto:igrigorik@google.com>> wrote:
Google search is rolling out <a ping> to mobile clients that support it and based on our measurements its saving 200-400ms on every click [1]. The latency savings by themselves are, of course, a huge win, but just as importantly, our metrics also show a significant improvement in number of successful navigations (one less redirect to go wrong + faster load of destination site).

a) Above should address the previously raised concerns over usefulness of <a ping> (and by implication, Beacon).
b) <a ping> lacks cross-browser support (limited to Safari and Chrome), which makes deployment a non-trivial exercise.

As a result, I believe that having a cross-browser implementation of Beacon API would be a big performance win. Plus, Beacon is also much more flexible and would enable many additional optimization opportunities, including optimizing for battery life of mobile handsets... In short, we need Beacon API!

On that note, Jonas and myself have put together a doc outlining some feedback and suggestions on current proposal:

Would love to hear any thoughts or feedback.


[1] https://plus.google.com/+IlyaGrigorik/posts/fPJNzUf76Nx
Received on Wednesday, 30 October 2013 18:37:03 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:04:37 UTC