Active WebSocket connections no longer prevent a page from entering the Back/Forward Cache (BFCache). By closing connections on BFCache entry instead of marking the document as ineligible, the browser allows pages with active websockets to be stored and restored.
Currently, any active WebSocket connection forces the browser to discard the page when the user navigates away, preventing it from being stored in the Back/Forward Cache (BFCache). We are changing this behavior to allow these pages to be cached by closing any active WebSocket connections upon entry. This approach mirrors the behavior for WebTransport. For web developers, this change is designed to be compatible with existing patterns. When a page is restored from BFCache, the browser fires the error and close events, enabling applications to simply trigger their existing reconnection logic to pick up where they left off.