this.addEventListener("activate", (event) => {
const cachesToKeep = ["v2"];
event.waitUntil(
caches.keys().then((keyList) =>
Promise.all(
keyList.map((key) => {
if (!cachesToKeep.includes(key)) {
return caches.delete(key);
}
return undefined;
}),
),
),
);
});CacheStorage: delete() method / notebook
CacheStorage: delete() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.