add clear caching

This commit is contained in:
sky
2025-11-04 22:09:32 -05:00
parent 51bac6f65f
commit 896b2a0133
3 changed files with 27 additions and 4 deletions

View File

@ -158,6 +158,18 @@
alert("not completed");
}
}
async function deleteAllCaches() {
try {
const cacheNames = await caches.keys();
await Promise.all(
cacheNames.map(cacheName => {
console.log(`Deleting cache: ${cacheName}`);
return caches.delete(cacheName);
})
);
} catch {}
}
</script>
</head>
<body>
@ -208,10 +220,11 @@
</section>
<section>
<h2>manage data</h2>
<p>not implemented</p>
<p>download & upload currently unfinished, use the cloud backups</p>
<button id="downloadData">download</button>
<button id="uploadData">upload</button>
<button onclick="wipeData()">wipe (erases all game data)</button>
<button onclick="deleteAllCaches()">wipe all cache</button>
</section>
</sections>
</body>