MCPcopy
hub / github.com/angular/angular / clearCacheForUrl

Method clearCacheForUrl

packages/service-worker/worker/src/data.ts:606–613  ·  view source on GitHub ↗

* Clear the state of the cache for a particular resource. * * This doesn't remove the resource from the LRU table, that is assumed to have * been done already. This clears the GET and HEAD versions of the request from * the cache itself, as well as the metadata stored in the age table.

(url: string)

Source from the content-addressed store, hash-verified

604 * the cache itself, as well as the metadata stored in the age table.
605 */
606 private async clearCacheForUrl(url: string): Promise<void> {
607 const [cache, ageTable] = await Promise.all([this.cache, this.ageTable]);
608 await Promise.all([
609 cache.delete(this.adapter.newRequest(url, {method: 'GET'}), this.config.cacheQueryOptions),
610 cache.delete(this.adapter.newRequest(url, {method: 'HEAD'}), this.config.cacheQueryOptions),
611 ageTable.delete(url),
612 ]);
613 }
614
615 private async safeFetch(req: Request): Promise<Response> {
616 try {

Callers 3

handleFetchMethod · 0.95
loadFromCacheMethod · 0.95
cacheResponseMethod · 0.95

Calls 3

allMethod · 0.45
deleteMethod · 0.45
newRequestMethod · 0.45

Tested by

no test coverage detected