← All scenarios

Back / forward cache restore

When a user clicks back or forward to return to a previous page, modern browsers may restore the page from a frozen-in-time cache (bfcache) instead of reloading it. That is great for speed, but it means scripts do not re-execute — so traditional pixels do not refire, and the visit goes uncounted. V2 listens for the restore event and fires a fresh pixel; V1 does not.

Each side runs the same scenario in its own iframe. The iframes load independently, so you can see how each pixel version behaves under identical conditions.

How to test:
  1. Wait until both columns show pixel ×1 and the "PIXEL FIRED" verdict.
  2. Click Navigate to bfcache park → below. This sends the parent page (and both iframes) to a parked page.
  3. On the park page, click Go back (or use the browser back button).
  4. When you arrive back here, check whether the page was restored from cache (status shown below the button) and watch the pixel counters.
Expected: If bfcache was used, V1 stays at ×1 — it has no concept of bfcache restore. V2 jumps to ×2, because V2 listens for the bfcache-restore event and fires a fresh pixel. If bfcache was NOT used (the page reloaded normally), both should rerun the load flow and end up at ×1 again.
Parent restored from bfcache: no (fresh load)
V1 · current pixel
Verdict
Initialising…
window.load
—
wire.js
—
pixel
—
Event timeline
  1. No events recorded yet…
Script tag for this scenario
<script type="text/javascript" async src="https://staging-api.wire.spbx.app/wire.js?account_id=79&property_id=6a2111320c2dee2dc5548935"></script>
V2 · proposed fix
Verdict
Initialising…
window.load
—
wire.js
—
pixel
—
Event timeline
  1. No events recorded yet…
Script tag for this scenario
<script type="text/javascript" async src="https://staging-api.wire.spbx.app/wire.js?pixel_id=6a211df10c2dee2dc5548936&account_id=79&property_id=6a2111320c2dee2dc5548935"></script>