MCPcopy Index your code
hub / github.com/angular/angular / clearAllCaches

Function clearAllCaches

packages/service-worker/worker/testing/cache.ts:215–229  ·  view source on GitHub ↗
(caches: CacheStorage)

Source from the content-addressed store, hash-verified

213// while the SW is still running (e.g. serving another tab) and keeps references to the deleted
214// caches.
215export async function clearAllCaches(caches: CacheStorage): Promise<void> {
216 const cacheNames = await caches.keys();
217 const cacheInstances = await Promise.all(cacheNames.map((name) => caches.open(name)));
218
219 // Delete all cache instances from `CacheStorage`.
220 await Promise.all(cacheNames.map((name) => caches.delete(name)));
221
222 // Delete all entries from each cache instance.
223 await Promise.all(
224 cacheInstances.map(async (cache) => {
225 const keys = await cache.keys();
226 await Promise.all(keys.map((key) => cache.delete(key)));
227 }),
228 );
229}

Callers 1

happy_spec.tsFile · 0.90

Calls 5

mapMethod · 0.80
keysMethod · 0.65
openMethod · 0.65
allMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…