这是indexloc提供的服务,不要输入任何密码
Skip to content

Page Unload Beacons #58

@clelland

Description

@clelland

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.

Read the complete Explainer.

Read the draft specification.

Feedback

I welcome feedback in this thread, but encourage you to file bugs against the draft specification.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions