From 19e8570ac0a82daa4aa46e0e4ab44379e3d058ba Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Mon, 24 Jun 2019 15:04:16 +0300 Subject: [PATCH] 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 --- packages/service-worker/worker/src/data.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/service-worker/worker/src/data.ts b/packages/service-worker/worker/src/data.ts index 48abdae76b..8850877ed8 100644 --- a/packages/service-worker/worker/src/data.ts +++ b/packages/service-worker/worker/src/data.ts @@ -395,9 +395,7 @@ export class DataGroup { } // No response in the cache. No choice but to fall back on the full network fetch. - res = await networkFetch; - await this.cacheResponse(req, res, lru, true); - return res; + return networkFetch; } private networkFetchWithTimeout(req: Request): [Promise, Promise] {