Back should restore the page as it was left
Aliases: restore on back · state restoration · bfcache · keep-alive on pop
What it is
Back is not opening a page again. It is returning to the frame just left. The minimum state restoration demand is that the frame still looks like it did on departure—same place, same sense of what was in progress—rather than a fresh first screen. The browser’s back-forward cache and an undestroyed native page on the back stack already make that promise. A product that re-runs the page as a new visit on Back turns “undo the last forward” into “open another page of the same kind.”
This leaf only states the principle: Back must hand back the original frame, not a reset. How far the list had scrolled, whether filters survive, and whether a mutated list should align on an object or on pixels are finer persistence problems, not expanded here.
Why it happens
Back is treated as temporal undo. Working memory still holds a visual snapshot of the page at departure: whereabouts in the list, how far the form was filled, which card was open. If the snapshot does not match, undo has failed—people suspect the wrong page, or believe the system discarded the work. Failures cluster in three places: the router treats Back as a new fetch plus first paint; the SPA tore down the previous view and rebuilds initial state on return; the mobile OS killed the previous activity to reclaim memory and the instance state was never written.
SPAs trip especially easily. Destroy the list on forward, then useEffect with default params on return, and the first paint is “thrown to the top.” Native onCreate treated as a fresh launch, ignoring savedInstanceState, is the same bug. Users cannot tell “this is Back” from “this is a new open,” because the first frames were made identical.
Studying it
Use a leave–return pair: create observable state on a list or form (scroll past one screen, check an item, open a panel), go forward, come back, and score whether the state remains.
- Independent variables: implementation (bfcache hit / ordinary reload / SPA teardown-and-rebuild / restore after process death), duration away.
- Dependent variables: observable difference from the pre-leave snapshot, whether participants describe the return as a “new open,” how often prior actions are repeated.
- Methodological note: scoring only “same URL” misses a whole class of failures—the URL is right, the state is initial. Before leaving, perform an action that cannot be read from the URL (scroll, an uncommitted check). Instant lab returns overestimate bfcache; send the app to the background for tens of seconds to expose the process-death path.
Where it stops holding
If the user completed an action on the next page that makes the previous frame stale (deleted the item just viewed, submitted the form, signed out), the original frame must not be frozen as-is, or restoration replays a world that no longer exists. Pages with server-side locks (checkout, seat maps) may have released the lock while the user was away; appearance can be restored but capability has changed, so revalidate rather than trust the local snapshot. Read-only content updated by an editor while away is a stale copy; freshness outranks “restore as left.”
Applying it
- Implement Back as restoring an existing instance or hitting bfcache, not as a new navigation to the same path. Keep component state for views sitting on the stack; do not refetch with defaults on every
pageshow. - When the process may be killed, write a minimal instance state (current route, key UI open/closed) before leaving and read it on recreate; do not rely only on in-memory Vue/React state.
- The first frame after Back must not flash the default first screen and then jump. That read as a reset.
- Verify: scroll a list past one screen and expand a row, open a detail, go Back. The row stays expanded, the place stays put, no flash of the top. Then background the app long enough that it may be reclaimed and walk the back stack on a cold start; the same pair must still hold.
Related
- Within the group: G4.01.1 Back to the previous page is not the same as up to the parent level · G4.01.2 Arrival from another source leaves Back's destination undefined
- Adjacent: G4.03 State persistence · G4.07 State persistence and position restoration · I3.06 State persistence
- Search terms:
state restoration·bfcache·back stack