aboutsummaryrefslogtreecommitdiff
path: root/sw.js
blob: d92406283f355e8ed771eba291d5c8d47eb1f9d8 (plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
importScripts('cache-polyfill.js');

self.addEventListener('install', function(e) {

e.waitUntil(

caches.open('Navan Chauhan').then(function(cache) {

return cache.addAll([

'/css/menu.css',
  
  '/js/menu.js',
  'css/style.css',
  'css/timeline.css',
  '/js/timeline.js',

'/index.html',

'/Contact.html',
'/projects.html',

'/404.html'


]);

.then(() => self.skipWaiting());
    })
  )
});

self.addEventListener('activate',  event => {
  event.waitUntil(self.clients.claim());
});

self.addEventListener('fetch', event => {
  event.respondWith(
    caches.match(event.request, {ignoreSearch:true}).then(response => {
      return response || fetch(event.request);
    })
  );
});