Skip to Content
Platform.Ontology

Back forward cache

The browser freezes a left page whole and restores it instantly on Back, with scripts and state intact.

Gets silentlyFiles and storageIn sessionWeb browsersAfter you leave the siteWhile you use it

In one line

Can freeze this page when you leave and bring it back instantly on Back

The browser freezes a left page whole and restores it instantly on Back, with scripts and state intact.

A person who leaves and presses Back can resume the same JavaScript heap, form values and open connections. Analytics must treat pageshow with persisted=true as a new view. The page can run no code while frozen.

What it can and can't do

What the user does: You tap Back or Forward to return to the page.

It can

  • Keep the page exactly how you left it
  • Restore your scroll spot and typed text
  • Run a bit of code when the page comes back

It cannot

  • Keep the page running while it is frozen
  • Keep it frozen for long, since browsers drop it after a few minutes or when memory is low
  • Freeze pages that hold certain open connections

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported42010-01-25None
EdgeSupported122015-07-29None
FirefoxSupported112012-03-13None
SafariSupported52010-06-07None
Safari on iPhoneSupported42010-06-21None
Chrome on AndroidSupported182012-06-27None
Samsung InternetSupported1.02013-04-27None

How a site asks for it

APIpageshow / pagehide events with event.persisted
Browser compat keysapi.PageTransitionEvent.persisted
How access is grantednone
What the user seesNone
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsChrome keeps pages about 10 minutes (up to 6 entries on Android is not documented, verify)
How to take it backClear site data, browser privacy settings
Inside an iframeNot listed

Data you get

What comes back: pageshow persisted flag
Shape: event
How often: per back navigation

FieldTypeUnitRangePrecision
persistedbooleannonetrue or falseexact

Technical limits

  • Pages with unload handlers or open WebSockets may be excluded
  • Cache-Control: no-store pages are mostly excluded
  • Cannot run timers or fetches while frozen

The story

What it is

The browser freezes a page you leave and restores it instantly when you press Back.

For you

You press Back and the page returns in an instant, exactly as you left it, scroll spot and typed text included. You did not wait for it to load.

For makers

Makers love it because a fast Back button keeps people browsing and buying. They must make sure the page restores safely, for example by refreshing timers and logins after the restore.

Where you see it

TypeExampleApps
shoppingYou open a product, press Back, and the search results return instantly with your scroll spot saved.Amazon, eBay
newsYou read a story, press Back, and the front page comes back with nothing reloaded.None named
gamesA browser game page is frozen when you leave and resumes at once, unless it blocks the freeze with open connections.None named
adsAn ad script has to handle a page restored from the cache, or it counts one view and misses the next.None named
analyticsA measurement tool uses the restore event to count a Back visit as a new page view.Google Analytics
bankingA bank page asks the browser not to freeze it, so a returning user must log in again.None named
socialA feed page returns instantly after you view a photo and keeps your place.None named

Risks

  • Stale pages
  • Sensitive pages may linger

What the platform says

Good uses and abuse

Legitimate uses

  • Instant back navigation

Known abuse

  • Stale data after restore, double counted analytics

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility3 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2021-11, Chrome 96: bfcache enabled on desktop
  • 2024-01, Chrome 123: Cache-Control: no-store pages begin to be eligible in a gradual rollout (verify)

Sources

How well checked: Based on official documentation.

On this page