Comparison
Back-forward cachevsScroll restoration
Back-forward cache
you pressed back and the previous page appeared instantly, exactly as you left it, with no requests.
The browser freezing a whole page — DOM, heap, scroll position — when you navigate away, and restoring it on back or forward. It makes history navigation effectively free, and it is disabled by a list of things: an `unload` handler, `no-store` on the document, an open connection the browser will not freeze. The `pageshow` event with `persisted` set is how you detect a restore and refresh anything that has gone stale.
Full entry →Scroll restoration
you pressed back and landed at the top of the list instead of where you had scrolled to.
Returning the scroll position when a history entry is revisited, which the browser does automatically for real navigations and which a client-side router must reimplement. Getting it right means restoring after the content has rendered, which is genuinely hard with asynchronous data and virtualised lists. Setting `history.scrollRestoration` to manual is the first step; the rest is bookkeeping per history entry.
Full entry →