---
title: "Measuring the back/forward cache with Application Metrics"
description: "The back/forward cache (bfcache) allows instant page restores by freezing snapshots, yet its hits register no events in traditional telemetry, creating a blind spot for teams. Sentry’s bfcacheMetricsIntegration fills this gap by modeling three browser-provided signals as application metrics: a navigation counter with hit/miss outcome, a per-reason counter for misses via the notRestoredReasons API, and a distribution of fallback reload duration. The integration is opt-in and launched in JavaScript SDKs v11; detailed miss reasons are currently Chromium-only due to browser API support. Users can query these metrics to break down bfcache health by route, release, or browser, enabling discovery of regressions caused by unload listeners, cache-control headers, or third-party scripts. This turns the bfcache from an invisible performance feature into a measurable, trackable signal that teams can monitor and improve."
---

# Measuring the back/forward cache with Application Metrics

[Sentry](https://yomu.fyi/company/sentry) · Abdelrahman Awad · Sep 24, 2026

**Type:** Announcement

## Summary

The back/forward cache (bfcache) allows instant page restores by freezing snapshots, yet its hits register no events in traditional telemetry, creating a blind spot for teams. Sentry’s bfcacheMetricsIntegration fills this gap by modeling three browser-provided signals as application metrics: a navigation counter with hit/miss outcome, a per-reason counter for misses via the notRestoredReasons API, and a distribution of fallback reload duration. The integration is opt-in and launched in JavaScript SDKs v11; detailed miss reasons are currently Chromium-only due to browser API support. Users can query these metrics to break down bfcache health by route, release, or browser, enabling discovery of regressions caused by unload listeners, cache-control headers, or third-party scripts. This turns the bfcache from an invisible performance feature into a measurable, trackable signal that teams can monitor and improve.

## Context

The back/forward cache (bfcache) lets browsers instantly restore pages on back/forward navigations, but its hits produce no page-load events, making them invisible to standard performance tools. Teams cannot measure bfcache health because success is silent, while regressions from browser heuristics, unload listeners, or cache-control headers go undetected. This blind spot is especially damaging for high-frequency navigation flows in ecommerce, search, documentation, and media browsing. Sentry’s existing tools relied on the page-load lifecycle, so bfcache restores were never recorded. The bfcacheMetricsIntegration was built to expose this gap by turning browser bfcache signals into measurable application metrics.

## Approach / What changed

The bfcacheMetricsIntegration models three browser signals as application metrics: browser.bfcache.navigation (counter with hit/miss outcome), browser.bfcache.not\_restored (counter per not-restored reason, Chromium-only), and browser.bfcache.reload.duration (distribution of fallback reload time in milliseconds). It leverages the pageshow event and notRestoredReasons API. Users enable it with a one-liner: Sentry.bfcacheMetricsIntegration(). The integration is opt-in and shipped in JavaScript SDKs v11. Teams query the metrics to break down health by route, release, or browser, and build custom dashboards using agentic dashboard creation.

## Takeaways

- The bfcacheMetricsIntegration captures three signals: navigation outcome (hit/miss), not-restored reasons (Chromium-only), and the duration of fallback reloads on a miss, enabling teams to measure bfcache health.
- Traditional performance tools miss bfcache hits because restored pages fire no pageload event; this integration fills that gap by using the pageshow event and notRestoredReasons API.
- Bfcache eligibility can regress due to unload listeners, Cache-Control: no-store headers, open connections, or third-party scripts; the integration makes these detectable without code changes or redeploys.

## FAQ

### How do I enable the bfcacheMetricsIntegration in Sentry?

Add Sentry.bfcacheMetricsIntegration() to the integrations array in Sentry.init(). The integration is opt-in and available in JavaScript SDKs v11. It then emits application metrics for back/forward navigations.

### Which browsers support the detailed not-restored reasons?

Detailed not-restored reasons are currently Chromium-only, as they depend on the notRestoredReasons API. Hit/miss outcomes work across modern browsers. Coverage will widen as other engines ship the API.

### What metrics does bfcacheMetricsIntegration emit?

It emits three application metrics: browser.bfcache.navigation (counter with hit/miss outcome), browser.bfcache.not\_restored (counter per reason, Chromium-only), and browser.bfcache.reload.duration (distribution of fallback reload time in milliseconds). These carry attributes like reason, frame, and outcome.

**Tags:** [bfcache](https://yomu.fyi/topic/bfcache), [JavaScript](https://yomu.fyi/topic/javascript), [Performance](https://yomu.fyi/topic/performance), [Sentry](https://yomu.fyi/topic/sentry)

- Source: [Sentry](https://blog.sentry.io/bfcache-metrics)
- Source URL: https://blog.sentry.io/bfcache-metrics
- Ingested by Yomu: 2026-09-24T21:00:11.883Z

[Read original post](https://blog.sentry.io/bfcache-metrics)
