You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the worries to use IndexedDB is resource management used by them. For example, developers need to remember all database names and delete all unused databases.
indexedDB.open('a');// 3 years laterindexedDB.deleteDatabase('a');indexedDB.deleteDatabase('b');
...
indexedDB.deleteDatabase('y');indexedDB.open('z');
It is too complicated. If IndexedDB can be set the expiry, developers don't need to write the code for management.
indexedDB.open('a',0,30*24*3600*1e3);// will be automatically deleted 30 days later since last access.// 3 years laterindexedDB.open('z',0,30*24*3600*1e3);
The text was updated successfully, but these errors were encountered:
This is hot! With expirationTime unused or unnecessary databases would be removed, which is now impossible. Maybe with an absoulute time value such as expirationDate range of possibilities would be more rewarding. It would be still possible to make it relevant (for example: set expiration to 30 days later). Cookies have something similar.
Another solution for this "resource" management would be getting list of all databases names, then deleted the unnecessary ones. However expiration of a database is still better option.
When expiration is set, it should be renewed with any next database opening.
I'm neutral on expiration; rather than a one-off solution per storage type (e.g. IDB, Cache, ...) having some sort of scheduled notification fired at service workers which can wake up and do work might be a better platform addition. But definitely keeping this open to track the use case.
One of the worries to use IndexedDB is resource management used by them. For example, developers need to remember all database names and delete all unused databases.
It is too complicated. If IndexedDB can be set the expiry, developers don't need to write the code for management.
The text was updated successfully, but these errors were encountered: