fast-calorie/public/sw.js

36 lines
610 B
JavaScript

const CACHE_NAME = "version-1";
const CACHE_FILES = [
"/", "index.html", "404.html",
"/css/styles.css"];
const self = this;
self.addEventListener("install", function(e) {
e.waitUntil(
caches.open(CACHE_NAME).then((cache) => {
console.log('caches opened');
return cache.addAll(CACHE_FILES);
})
)
});
self.addEventListener("fetch", function() {
});
self.addEventListener("sync", function() {
});
self.addEventListener("push", function() {
});
self.addEventListener("activate", function() {
});
self.addEventListener("message", function() {
});