System Design · Middle · Question 47 of 75

What is the back/forward cache and how do you avoid breaking it?

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.

Further reading

Problem with a question

System Design · Middle · question 47

Test yourself

Take the System Design · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz