-
-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Dexie prevents the browser from enabling the bfcache because of the usage of BroadcastChannel #1776
Comments
Here is a github issue that relates between bfcache and BroadcastChannel whatwg/html#7253 |
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. |
I'm running into this exact problem as well. Firefox, Chrome, and Edge all will ignore the |
Solved in dexie@4.0.1-beta.7 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. |
Hello,
I noticed that the browser wasn't using bfcache with my app, lighthouse was giving me the error message:
I found out that Dexie was using the BroadcastChannel, after removing it, the bfcache was working.
My question is, can we make the usage of the broadcast channel optional ? Or eventually can we delay the opening of the BroadcastChannel until Dexie opens the connection to the database?
For me it will mean that most of the users will be able to experiment the bfcache, and only a few users (who need Dexie) won't.
Thank you for your help.
The text was updated successfully, but these errors were encountered: