Instant navigations · mid
The back/forward cache (bfcache)
The bfcache keeps a full snapshot of a page in memory, JavaScript state included, so Back and Forward restore it instantly; pages lose eligibility through unload handlers, open connections and (outside Chrome's newer rules) Cache-Control: no-store.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- All major browsers have a bfcache. A restore needs no network and no JS re-run, so LCP and INP for that view are near zero and CLS resets.
- Detect a restore with pageshow where event.persisted === true; use it to refresh stale data (cart count, logged-in state).
- Use pagehide (or visibilitychange) instead of unload. unload listeners block bfcache in Firefox and older Chrome, and Chrome is deprecating unload.
- Cache-Control: no-store on the HTML used to block bfcache everywhere. Since 2025 Chrome can cache no-store pages, but evicts them if cookies change and keeps them only 3 minutes; other browsers may still block them.
- Open WebSocket/WebRTC connections or in-progress fetches can block bfcache; close them on pagehide and reopen on pageshow.
- Test with DevTools > Application > Back/forward cache > Run test; Lighthouse also has a bfcache audit.
The red pen
Common traps: mistake → fix
Mistake: "Back navigation reloads the page from the HTTP cache"
Fix: with bfcache the whole page, JS heap included, is restored from memory without reloading.
Mistake: "Use unload to send analytics"
Fix: unload is unreliable and blocks bfcache; use visibilitychange/pagehide.
Mistake: "no-store is harmless for speed"
Fix: on many browsers it disables bfcache; use no-cache when you only need freshness.
Easy to hard
Questions interviewers ask, easy to hard
- What is the bfcache and why does it matter for Core Web Vitals?
- What makes a page ineligible?
- How do you handle stale data after a bfcache restore?
- Our banking pages send Cache-Control: no-store. What does that do to back navigation, and what would you change?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.