From 8131e06e864e98644f8f730b34d57f6b8d912dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Tainon?= Date: Thu, 3 Mar 2022 17:44:23 +0100 Subject: [PATCH] Fix offline precaching due to revision query parameter --- 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 039fd0d7..be732839 100644 --- a/templates/workbox/sw.js +++ b/templates/workbox/sw.js @@ -96,7 +96,7 @@ function offlinePage(workbox, options) { const strategy = new workbox.strategies[options.offlineStrategy] return strategy .handle({ request, event }) - .catch(() => caches.match(options.offlinePage)) + .catch(() => caches.matchPrecache(options.offlinePage)) }) } } diff --git a/test/__snapshots__/pwa.test.js.snap b/test/__snapshots__/pwa.test.js.snap index 1abb6ab0..88166db0 100644 --- a/test/__snapshots__/pwa.test.js.snap +++ b/test/__snapshots__/pwa.test.js.snap @@ -200,7 +200,7 @@ function offlinePage(workbox, options) { const strategy = new workbox.strategies[options.offlineStrategy] return strategy .handle({ request, event }) - .catch(() => caches.match(options.offlinePage)) + .catch(() => caches.matchPrecache(options.offlinePage)) }) } }