wtf( )unctionsystem design, drawn
← all problemsWeb PerformanceMedium

The back button that rebuilds the page

Pressing back re-runs everything — the page reloads, layout shifts as images arrive, and the user waits again for a page they were just looking at. Browsers can restore a page instantly from memory instead, fully rendered and scrolled where it was.

This page is disqualified from that, by one listener added years ago for analytics.

Replace what disqualifies the page from being restored.
Components — tap one, then tap a slot on the diagram
!Back navigation rebuilds the page from scratch instead of restoring it instantly.

Outside every boundary: The page (user navigates away), Instant restore (fully rendered, in memory), Full rebuild (what happens today; FAILED: slow back), an empty slot for the the departure hook Connections: The page calls the departure hook — leaving (step 1) the departure hook calls Instant restore — still eligible (step 2) the departure hook must NOT reach Full rebuild — no longer necessary

The pageuser navigates away
Instant restorefully rendered, in memory
Full rebuildwhat happens todayslow back