NotRestoredReasonDetails: reason property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The reason read-only property of the NotRestoredReasonDetails interface returns a string describing a reason that the page was blocked from using the back/forward cache (bfcache).

Value

A string.

There are many different reasons why blocking could occur, and browsers can choose to implement their own specific reasons for blocking, based on how they operate. Developers should avoid depending on specific wording for reasons and be prepared to handle new reasons being added and deleted.

The initial values listed in the specification are:

"fetch"

While unloading, a fetch initiated by the current document (e.g., via fetch()) was canceled while ongoing. As a result, the page was not in a stable state that could be stored in the bfcache.

"lock"

While unloading, held locks and lock requests were terminated, so the page was not in a stable state that could be stored in the bfcache.

"masked"

The exact reason is hidden for privacy purposes. This value can mean one of the following:

  • The current document has children contained in a cross-origin <iframe>, and they prevented storage in the bfcache.
  • The current Document could not be stored in the bfcache for user agent-specific reasons.

The original navigation that created the current document errored, and storing the resulting error document in the bfcache was prevented.

"parser-aborted"

The current document never finished its initial HTML parsing, and storing the unfinished document in the bfcache was prevented.

"websocket"

While unloading, an open WebSocket connect was shut down, so the page was not in a stable state that could be stored in the bfcache.

Additional blocking reasons may be used by some browsers, for example:

"unload-listener"

The page registers an unload handler, which prevents bfcache usage. This serves as a useful warning, as unload is deprecated. See usage notes for more information.

"response-cache-control-no-store"

The page uses no-store as a Cache-Control header value.

The page was opened from another page that still has a reference to this page, for example using "duplicate tab" functionality.

Examples

See Monitoring bfcache blocking reasons for examples.

Specifications

Specification
HTML
# dom-not-restored-reason-details-reason

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
reason
Experimental
Chrome – Full support
Chrome 125 (Release date: 2024-05-14)
footnote Full support
Edge – Full support
Edge 125 (Release date: 2024-05-17)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 111 (Release date: 2024-06-12)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 125 (Release date: 2024-05-14)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 83 (Release date: 2024-06-25)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 27 (Release date: 2024-11-06)
footnote Full support
WebView Android – Full support
WebView Android 125 (Release date: 2024-05-14)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

See also