Re: [w3c/IndexedDB] How should IDB connections and outstanding IDB transactions behave when a page enters back/forward cache? (Issue #381)

I did an exploration of this a while ago. The best option I came up with was:

- disallow page from bfcache if there are pending or active indexeddb transactions.
- Allow a page into bfcache if there is a database connection, but keep track of the locked version (referenced by the connection)
  - keep track in a table of origin + database name -> version locked
  - Keep track of new database connection requests
  - If a database connection request (origin + database name) requests a version that is different from the locked version, then kill the bfcache page with that connection. 

This assumes pages mostly don't have active IDB transactions, which I think is a safe assumption.


Why keep track of the DB version? The current API requires the old database connection respond to an 'onversionchangerequested' event when a newer version is attempting to be opened. Since that old connection is in the cache & js is not executing, this doesn't really work, and would block the new connection from opening.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/381#issuecomment-1128990151
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/IndexedDB/issues/381/1128990151@github.com>

Received on Tuesday, 17 May 2022 15:09:16 UTC