GO-V.ORG
As seen in

NotRestoredReasonDetails: reason property

Performance API

Performance API

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.
- `"navigation-failure"`
- : 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](/docs/Web/API/WebSockets_API) 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`](/docs/Web/API/Window/unload_event) handler, which prevents bfcache usage. This serves as a useful warning, as `unload` is deprecated. See [usage notes](/docs/Web/API/Window/unload_event#usage_notes) for more information.
- `"response-cache-control-no-store"`
- : The page uses `no-store` as a Cache-Control header value.
- `"related-active-contents"`
- : 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](/docs/Web/API/Performance_API/Monitoring_bfcache_blocking_reasons) for examples.

## Specifications

## Browser compatibility

## See also

- [Monitoring bfcache blocking reasons](/docs/Web/API/Performance_API/Monitoring_bfcache_blocking_reasons)
- PerformanceNavigationTiming.notRestoredReasons

source: MDN Web Docs mirror · page

Cite this

"NotRestoredReasonDetails: reason property". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/NotRestoredReasonDetails/reason

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·