Skip to content

fix: handle bfcache (back-forward cache) correctly #62

@adnaan

Description

@adnaan

Browsers may serve pages from bfcache on back/forward navigation, preserving the full JavaScript heap. This can cause stale WebSocket connections and event listeners.

Expected behavior: Listen for `pageshow` event with `event.persisted` flag. If the page was restored from bfcache, reconnect WebSocket and reinitialize state.

Reference: web.dev bfcache guide.

Discovered during cross-handler SPA navigation research (PR #58).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions