From 2a005c4be3dbef6671f2972bcafc7e7c3c0c6d2c Mon Sep 17 00:00:00 2001 From: EloyID Date: Mon, 6 Apr 2020 16:56:16 +0200 Subject: [PATCH] cache.put receiving request and not the static files I'm not totally sure about this, just came here from your post. Verify it's correct, but I think cache.put should receive the request and not the html files --- sw.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw.js b/sw.js index 47305b4..366e9e1 100644 --- a/sw.js +++ b/sw.js @@ -42,7 +42,7 @@ self.addEventListener('fetch', (event) => { } if (/html/.test(contentType)) { - caches.open(version).then(cache => cache.put(HTMLToCache, clonedResponse)); + caches.open(version).then(cache => cache.put(event.request, clonedResponse)); } else { // Delete old version of a file if (hasHash(event.request.url)) {