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
Both of these modules use the cache name as the IDB name, but this means if I pass the cache expiration plugin to precache.activate(), it errors because the names are the same.
I think all packages that create IDB databases should (wherever possible) use the package name as the IDB database name. If more than one database is needed, then we can use the package name as a prefix. This will eliminate the possibility of naming collisions.
In the case of the cache expiration plugin, only one database is needed. Instead of creating multiple databases, we can create a single database with a single object store and use the cache name as an indexed property in the object store. We take this same approach with tag names in workbox-background-sync.
The text was updated successfully, but these errors were encountered:
We now have a way of automatically completely deleting the IndexedDB storage along with cached entries as part of a "delete everything" method in workbox-cache-expiration:
* Removes the underlying IndexedDB object store entirely.
*/
asyncdelete(){
awaitthis._db.deleteDatabase();
this._db=null;
}
}
I believe that that deletion operates on the object store level, rather than the database level, so maybe your suggestion still stands. But we should obviously make sure that we don't accidentally introduce a change that causes workbox-precaching data to be deleted when the "delete everything" method is invoked in workbox-cache-expiration.
Library Affected:
workbox-precaching, workbox-cache-expiration
Both of these modules use the cache name as the IDB name, but this means if I pass the cache expiration plugin to
precache.activate()
, it errors because the names are the same.I think all packages that create IDB databases should (wherever possible) use the package name as the IDB database name. If more than one database is needed, then we can use the package name as a prefix. This will eliminate the possibility of naming collisions.
In the case of the cache expiration plugin, only one database is needed. Instead of creating multiple databases, we can create a single database with a single object store and use the cache name as an indexed property in the object store. We take this same approach with tag names in
workbox-background-sync
.The text was updated successfully, but these errors were encountered: