diff --git a/motorradig/public/sw.js b/motorradig/public/sw.js index 4a954cd..b9f45d8 100644 --- a/motorradig/public/sw.js +++ b/motorradig/public/sw.js @@ -113,8 +113,12 @@ async function networkFirstNavigation(request) { function staleWhileRevalidate(request, event) { var network = fetch(request).then(function (response) { if (response && response.ok && response.type === 'basic') { - caches.open(CACHE_VERSION).then(function (cache) { - cache.put(request, response.clone()); + var copy = response.clone(); + + return caches.open(CACHE_VERSION).then(function (cache) { + return cache.put(request, copy); + }).then(function () { + return response; }); }