-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsw.js
More file actions
25 lines (24 loc) · 873 Bytes
/
sw.js
File metadata and controls
25 lines (24 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
self.addEventListener("install", e => {
e.waitUntil(
caches.open("static").then(cache => {
return cache.addAll(["./",
"./fonts/press-start-2p-v9-latin-regular.eot",
"./fonts/press-start-2p-v9-latin-regular.svg",
"./fonts/press-start-2p-v9-latin-regular.ttf",
"./fonts/press-start-2p-v9-latin-regular.woff",
"./fonts/press-start-2p-v9-latin-regular.woff2",
"./src/styles.css",
"./src/jquery.min.js",
"./src/app.js",
"./icons/manifest-icon-192.maskable.png"]);
})
);
});
self.addEventListener("fetch", e => {
//console.log(`Intercepting fetch request for: ${e.request.url}`);
e.respondWith(
caches.match(e.request).then(response => {
return response || fetch (e.request);
})
);
});