-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Introduction
Beacons on the web are a common tool for web sites to send small amounts of data to an origin server, often used for reporting telemetry and analytics. For several reasons, though, that API (as well as other methods such as XHR, image beacons, or direct use of Fetch) is often unreliable, and difficult to use to accurately report full-page-lifecycle metrics. (See @nicjansma's excellent survey of existing techniques and their reliability in practice here)
This proposal is for an API which attempts to improve some on some of those concerns, with reliability as a primary motivation, and designed to integrate with the browser's back-forward cache. The basic mechanism involves the web site creating a "Pending beacon", which can be populated with data like existing beacons. This beacon, by default, is not sent until the page is about to be unloaded from the browser's memory, but can optionally be sent a short time after entering the bfcache, or even immediately if desired.
Feedback
I welcome feedback in this thread, but encourage you to file bugs against the draft specification.