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

Re: [Beacon] spec feedback + few suggestions

From: Ilya Grigorik <igrigorik@google.com>
Date: Sun, 10 Nov 2013 18:41:28 -0800
Message-ID: <CADXXVKonLiMgMMS3DbFUTLOGnxfL=xxi4L=5H5p=4-SCqRG5qA@mail.gmail.com>
To: David Bruant <bruant.d@gmail.com>
Cc: "Reitbauer, Alois" <Alois.Reitbauer@compuware.com>, Jatinder Mann <jmann@microsoft.com>, "Austin, Daniel" <daaustin@paypal.com>, Jonas Sicking <jonas@sicking.cc>, Chase Douglas <chase@newrelic.com>, public-web-perf <public-web-perf@w3.org>
On Sun, Nov 10, 2013 at 12:57 PM, David Bruant <bruant.d@gmail.com> wrote:

> Typically analytics beacons are set in the onunload or unbeforeunload
> events. However, analytics also sends data while a page is active.
> Typically you do this to avoid not getting data in case when the user would
> simply close the browser.
>
> This is already possible with xhr. The only thing sendBeacon adds is
> better scheduling for better battery use... and even that is arguable; an
> implementation could decide to better schedule xhrs.


That's not entirely true. Yes, in theory you can patch XHR such that next
time you make a request you also flush some pending queue of beacons, but
this is (a) non-trivial to implement / error-prone, and (b) does not work
across multiple apps / tabs - e.g. if you have multiple beacons firing
across multiple open tabs/apps, sendBeacon can aggregate those events and
dispatch them all at once.
Received on Monday, 11 November 2013 02:42:38 UTC

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