23 lines
762 B
JavaScript
23 lines
762 B
JavaScript
const cache_identifier = "scoicide-squad-cache-version-1";
|
|
|
|
self.addEventListener("install", function(installation_event) {
|
|
installation_event.waitUntil(
|
|
caches.open(cache_identifier).then(function(cache_object) {
|
|
return cache_object.addAll([
|
|
"/",
|
|
"/static/stylesheet.css",
|
|
"/static/behavior.js",
|
|
"/static/logo.svg",
|
|
"/static/manifest.json"
|
|
]);
|
|
})
|
|
);
|
|
});
|
|
|
|
self.addEventListener("fetch", function(network_fetch_event) {
|
|
network_fetch_event.respondWith(
|
|
caches.match(network_fetch_event.request).then(function(cached_response) {
|
|
return cached_response || fetch(network_fetch_event.request);
|
|
})
|
|
);
|
|
}); |