Back forward cache
The browser freezes a left page whole and restores it instantly on Back, with scripts and state intact.
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
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 4 | 2010-01-25 | None |
| Edge | Supported | 12 | 2015-07-29 | None |
| Firefox | Supported | 11 | 2012-03-13 | None |
| Safari | Supported | 5 | 2010-06-07 | None |
| Safari on iPhone | Supported | 4 | 2010-06-21 | None |
| Chrome on Android | Supported | 18 | 2012-06-27 | None |
| Samsung Internet | Supported | 1.0 | 2013-04-27 | None |
How a site asks for it
| API | pageshow / pagehide events with event.persisted |
| Browser compat keys | api.PageTransitionEvent.persisted |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Chrome keeps pages about 10 minutes (up to 6 entries on Android is not documented, verify) |
| How to take it back | Clear site data, browser privacy settings |
| Inside an iframe | Not listed |
Data you get
What comes back: pageshow persisted flag
Shape: event
How often: per back navigation
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
persisted | boolean | none | true or false | exact |
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
| Type | Example | Apps |
|---|---|---|
| shopping | You open a product, press Back, and the search results return instantly with your scroll spot saved. | Amazon, eBay |
| news | You read a story, press Back, and the front page comes back with nothing reloaded. | None named |
| games | A browser game page is frozen when you leave and resumes at once, unless it blocks the freeze with open connections. | None named |
| ads | An ad script has to handle a page restored from the cache, or it counts one view and misses the next. | None named |
| analytics | A measurement tool uses the restore event to count a Back visit as a new page view. | Google Analytics |
| banking | A bank page asks the browser not to freeze it, so a returning user must log in again. | None named |
| social | A 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
- web.dev: Back/forward cache. Google pitches it as a way to make Back and Forward feel instant by keeping whole pages in memory.
Good uses and abuse
Legitimate uses
- Instant back navigation
Known abuse
- Stale data after restore, double counted analytics
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough 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)
Related capabilities
Related
- pagehide, visibilitychange and unload. Can tell a page when you hide or leave it, so it can send a report
Sources
How well checked: Based on official documentation.