From dcb519fb099fd031f6fc933bf5edd78127194700 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 20 Dec 2020 16:19:46 +0100 Subject: [PATCH] fix: explicitly set cache to default --- templates/workbox/sw.js | 2 +- test/__snapshots__/pwa.test.js.snap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/workbox/sw.js b/templates/workbox/sw.js index 56169bfb..039fd0d7 100644 --- a/templates/workbox/sw.js +++ b/templates/workbox/sw.js @@ -55,7 +55,7 @@ function runtimeCaching(workbox, options) { const requestInterceptor = { requestWillFetch({ request }) { if (request.cache === 'only-if-cached' && request.mode === 'no-cors') { - return new Request(request.url, { ...request, mode: 'no-cors' }) + return new Request(request.url, { ...request, cache: 'default', mode: 'no-cors' }) } return request }, diff --git a/test/__snapshots__/pwa.test.js.snap b/test/__snapshots__/pwa.test.js.snap index d4d1ac6a..1abb6ab0 100644 --- a/test/__snapshots__/pwa.test.js.snap +++ b/test/__snapshots__/pwa.test.js.snap @@ -159,7 +159,7 @@ function runtimeCaching(workbox, options) { const requestInterceptor = { requestWillFetch({ request }) { if (request.cache === 'only-if-cached' && request.mode === 'no-cors') { - return new Request(request.url, { ...request, mode: 'no-cors' }) + return new Request(request.url, { ...request, cache: 'default', mode: 'no-cors' }) } return request },