refactor(service-worker): remove redundant cache operation (#30977)

At this point, the response will have been cached (or scheduled to be
cached) in other code paths, so caching it again is redundant.

PR Close #30977
This commit is contained in:
George Kalpakas 2019-06-24 15:04:16 +03:00 committed by Alex Rickabaugh
parent 93abc35213
commit 19e8570ac0
1 changed files with 1 additions and 3 deletions

View File

@ -395,9 +395,7 @@ export class DataGroup {
} }
// No response in the cache. No choice but to fall back on the full network fetch. // No response in the cache. No choice but to fall back on the full network fetch.
res = await networkFetch; return networkFetch;
await this.cacheResponse(req, res, lru, true);
return res;
} }
private networkFetchWithTimeout(req: Request): [Promise<Response|undefined>, Promise<Response>] { private networkFetchWithTimeout(req: Request): [Promise<Response|undefined>, Promise<Response>] {