{"action":"opened","issue":{"url":"https://api.github.com/repos/GoogleChrome/workbox/issues/2234","repository_url":"https://api.github.com/repos/GoogleChrome/workbox","labels_url":"https://api.github.com/repos/GoogleChrome/workbox/issues/2234/labels{/name}","comments_url":"https://api.github.com/repos/GoogleChrome/workbox/issues/2234/comments","events_url":"https://api.github.com/repos/GoogleChrome/workbox/issues/2234/events","html_url":"https://github.com/GoogleChrome/workbox/issues/2234","id":497912526,"node_id":"MDU6SXNzdWU0OTc5MTI1MjY=","number":2234,"title":"[ExpirationPlugin] Clean up individual cache entries and metadata from IndexedDB","user":{"login":"adityapunjani","id":2103527,"node_id":"MDQ6VXNlcjIxMDM1Mjc=","avatar_url":"https://avatars3.githubusercontent.com/u/2103527?v=4","gravatar_id":"","url":"https://api.github.com/users/adityapunjani","html_url":"https://github.com/adityapunjani","followers_url":"https://api.github.com/users/adityapunjani/followers","following_url":"https://api.github.com/users/adityapunjani/following{/other_user}","gists_url":"https://api.github.com/users/adityapunjani/gists{/gist_id}","starred_url":"https://api.github.com/users/adityapunjani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adityapunjani/subscriptions","organizations_url":"https://api.github.com/users/adityapunjani/orgs","repos_url":"https://api.github.com/users/adityapunjani/repos","events_url":"https://api.github.com/users/adityapunjani/events{/privacy}","received_events_url":"https://api.github.com/users/adityapunjani/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-09-24T20:39:51Z","updated_at":"2019-09-24T20:39:51Z","closed_at":null,"author_association":"NONE","body":"\r\n**Library Affected**:\r\nworkbox.expiration.Plugin\r\n\r\n**Browser & Platform**:\r\nall browsers.\r\n\r\n**Feature Request Description**:\r\nCurrently, we don't have a the method which can delete all the entries and metadata from IDB and cacheAPI for a given `cacheName`. A common use case with workbox deployments at scale is to delete cache entries namespaced by a `cacheName`. This requirement stems from basic versioning of caches, passed to runtime strategies, and when a cache version is bumped we want to clean up previous version's cache & IDB entries, usually in the `activate` event of the SW.\r\n\r\nThis is easily possible to do for CacheAPI entries but hard to work with IDB where the implementation is tightly coupled to Workbox. I'd love to hear thoughts on  `deleteCacheAndMetadata` API to accept an optional `cacheName` parameter that would purge only the CacheAPI and IDB entries for that specific cache name. \r\n\r\nProposed API `deleteCacheAndMetadata(cacheName)` \r\n\r\nImplementation: This should be fairly straightforward to implement for CacheAPI entries. For IDB we are currently using an IDBKeyRange such as ``IDBKeyRange.bound(cacheName, `${cacheName}\\uffff`);`` to deleted IDB entries manually outside of workbox. \r\n"}}
{"actor":{"display_login":"adityapunjani"}}