Code Monkey home page Code Monkey logo

Comments (4)

slevy85 avatar slevy85 commented on June 10, 2024

Here is a github issue that relates between bfcache and BroadcastChannel whatwg/html#7253

from dexie.js.

dfahlander avatar dfahlander commented on June 10, 2024

Thanks for sharing this information which wasn't something I was aware of. The issue seems to be broader than just BroadcastChannel - the indexedDB connection itself would prevent bfcache according to https://web.dev/bfcache/#always-close-open-connections-before-the-user-navigates-away

I suppose a correct solution would be to listen to the pagehide and pageshow events to take down BroadcastChannel and IDBConnections and bring them up again in the pageshow event if I understood the article correctly.

I suppose this would be doable but it would have to be done carefully in a prerelase at some point.

from dexie.js.

dsherley9 avatar dsherley9 commented on June 10, 2024

I'm running into this exact problem as well. Firefox, Chrome, and Edge all will ignore the bfcache, because of the registered listeners. However, it appears Safari doesn't behave this way and will still attempt to load the page from the bfcache regardless. The IndexedDB just ends up being in a corrupt state. Would be nice to opt into using the Service Worker implementation via configuration or have some sort of logic implemented to handle this.

from dexie.js.

dfahlander avatar dfahlander commented on June 10, 2024

Solved in [email protected] by subscribing to pagehide/pageshow and taking down BroadcastChannel and IDB connections. I've been able to verify that the BroadcastChannel isn't blocking the bfcache anymore.

from dexie.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.