* 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)
| 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 { |
no test coverage detected