[Beacon] Beacon API Specification

A few weeks earlier, Alois and I had reached out to other working groups describing the poor performance patterns used to send data during the beforeunload and unload handlers. To avoid overloading existing methods, which may cause confusion and hurt adoption for our use case, we had agreed on sharing a more concrete Beacon API proposal [1].

We have put together a proposal for the Beacon API in this specification: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/Beacon/Overview.html. Please review this specification and provide feedback.

Initially, we were considering whether to create a XHR variant or a separate Beacon API. However, considering some of our requirements differ significantly from the existing XHR, it appears that having a completely separate Beacon concept from XHR may be less confusing for developers. Similarly, it feels like Ping attempts to solve a somewhat different problem and I worry that overloading it too will cause confusion and hurt adoption.

One of the goals of this API is that developers use it as a reliable means of transmitting data without needing confirmation whether the data has successful been sent, as the user agent now takes that responsibility. However, this version of the proposal does not attempt to make a guarantee that the data will be sent, just a best effort. For example, we don’t plan on attempting to send the data again if it failed the first time or plan on persisting the data locally to send later if the browser has been shut down. If there is a demand for those scenarios, we can consider them further.


[1] http://lists.w3.org/Archives/Public/public-web-perf/2013Feb/0038.html

Received on Wednesday, 6 March 2013 16:45:23 UTC