Byte Corner

bfcache Lab

See how the browser preserves an entire page when you navigate away and return using Back.

Navigation result

Fresh document

This document was loaded normally. Navigate to Page B and press Back to test bfcache.

1. React state

Increment the counter before leaving Page A. If bfcache restores the page, this state survives.

0

2. Frozen JavaScript

While Page A is in bfcache, its JavaScript execution is suspended. Compare interval ticks with actual elapsed time after returning.

Interval ticks

0

Wall-clock seconds

0

Stay on Page B for 10 seconds. On restoration, wall-clock time catches up, but interval ticks do not count the time spent frozen.

3. Page lifecycle

The browser fires pageshow with persisted: true when restoring a document from bfcache.

Waiting for lifecycle events...

Test it

1. Increment the counter.

2. Click Go to Page B.

3. Wait 10 seconds on Page B.

4. Press your browser's Back button.

5. Check the state, timer, and lifecycle log.

Go to Page B →