v135 · fetch / performance

Session Heartbeat

A classic fetchLater() use case: a session keep-alive that is queued once and fires automatically when the page unloads or a deadline expires — even if JavaScript has been frozen. No sendBeacon race, no beforeunload hack.

checking fetchLater…
fetchLater(url, options) registers a request in the browser's deferred fetch queue. It fires at the earliest of: (1) the activateAfter deadline, (2) page unload, or (3) an explicit .abort(). A session heartbeat can use this to guarantee the server learns about session activity even when the user force-closes the tab.

Heartbeat status

Not started
Configure and click "Queue heartbeat"

Timeline

Event log

Queue a heartbeat to see events…

Generated code