Skip to content

Instantly share code, notes, and snippets.

@jswhisperer
Last active May 5, 2025 20:11
Show Gist options
  • Save jswhisperer/65d9e02c8166b92f09060c5ac66f7643 to your computer and use it in GitHub Desktop.
Save jswhisperer/65d9e02c8166b92f09060c5ac66f7643 to your computer and use it in GitHub Desktop.
CacheStorage listing
log out your caches and entries
(await caches.keys()).map(async (cacheName) => {
console.log(cacheName);
const cache = await caches.open(cacheName);
console.log(await cache.keys());
});
// get all caches, and entries, and merge them into one array
(await Promise.all((await caches.keys()).map(async (cacheName) => await (await caches.open(cacheName)).keys()))).flat()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment