-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathServiceWorker.js
More file actions
27 lines (25 loc) · 731 Bytes
/
ServiceWorker.js
File metadata and controls
27 lines (25 loc) · 731 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
26
27
const digitalBaconCache = "digital-bacon-site-v0.0.1";
const assets = [
"/",
"/app",
"/projects/default-project.zip",
"/css/app.css",
"/build/DigitalBacon.min.js",
"/node_modules/three/build/three.module.js",
"https://apis.google.com/js/api.js",
"https://maxst.icons8.com/vue-static/landings/line-awesome/line-awesome/1.3.0/css/line-awesome.min.css",
];
self.addEventListener("install", installEvent => {
installEvent.waitUntil(
caches.open(digitalBaconCache).then(cache => {
cache.addAll(assets);
})
);
});
self.addEventListener("fetch", fetchEvent => {
fetchEvent.respondWith(
caches.match(fetchEvent.request).then(res => {
return res || fetch(fetchEvent.request);
})
);
});