Hi Storage Devs,
TL;DR:
We want to modify the IndexedDB code to support the invalidation signals API. Please help to review the corresponding section in our design proposal.
Background:
BFCache team is planning to build a set of invalidation signals APIs that allow the site owner to specify some "invalidation signals" via JavaScript, and the page will be prevented from entering (or invalidated if the page is already in) some inactive states like prerendering and BFCache, if any of the signals is modified.
An example use case would be: assuming the site is using IndexedDB to store some credentials that mark the user's login status, and the page is currently frozen in BFCache. If the user performs logout from another tab, resulting in the changes to the IndexedDB, then the BFCached page should be evicted.
For the detailed information, please refer to the
explainer.
Proposal:
We planned to maintain an IDB observer per connection that receives changes to certain object stores, and manipulate the inactive document states accordingly. The object stores to be observed will be set up in the first transaction after the page invokes the invalidation signal APIs.
Thanks a lot for the feedback in advance!
Mingyu