System Design · Middle · Question 47 of 75
What is the back/forward cache and how do you avoid breaking it?
- ✓Correct answer: A page snapshot for instant "back";
unloadandno-storeget in the way - 2A Service Worker cache of API responses for back and forward navigation
- 3An SPA router history cache enabled in
next.config
Explanation
bfcache stores a snapshot of the page with its JS state, so the "Back" button opens it instantly. unload handlers, Cache-Control: no-store and open connections can disqualify a page from this optimization. Use pagehide and visibilitychange instead of unload.