summaryrefslogtreecommitdiff
path: root/website/sw.js
blob: 03f2913ac37bba55107714bd83c47215ae6f050c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Cached core static resources 
self.addEventListener("install",e=>{
    e.waitUntil(
      caches.open("static").then(cache=>{
        return cache.addAll(["./",'./favicon.png', './index.html', './main.js', './vanilla-tilt.min.js', './style.css']);
      })
    );
  });
  
  // Fatch resources
  self.addEventListener("fetch",e=>{
    e.respondWith(
      caches.match(e.request).then(response=>{
        return response||fetch(e.request);
      })
    );
  });