Final commit (be carefull and change the service worker/manifest to adapt to your server)

This commit is contained in:
maxluli
2022-10-21 20:35:44 +02:00
parent 6e1512b4b8
commit c47ba48e0f
3 changed files with 63 additions and 3 deletions

3
sw.js
View File

@@ -20,6 +20,8 @@ self.addEventListener("fetch", event => {
)
);
});
/*
function cache(request, response) {
if (response.type === "error" || response.type === "opaque") {
return Promise.resolve(); // do not put in cache network errors
@@ -29,6 +31,7 @@ function cache(request, response) {
.open(CACHE_NAME)
.then(cache => cache.put(request, response.clone()));
}
*/
const CACHE_NAME = "V2";