Browser & Web Performance · Middle · Question 65 of 75
How can a page detect that it was restored from bfcache?
- 1
performance.now()is reset to 0 - ✓Correct answer: In a
pageshowevent,event.persistedistrue - 3
DOMContentLoadedfires a second time
Explanation
Use it to refresh stale data (e.g. cart contents). Use pagehide instead of unload for cleanup.