aboutsummaryrefslogblamecommitdiffhomepage
path: root/worker.js
blob: 9ccc44914e9240754380da6b9cb777434d8651be (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11





                                           




                                 
                                         
                                             

                                                   
                                      



                                                                       














                                                      
self.addEventListener('install', event => {
    event.waitUntil(
        caches
            .open('homer')
            .then(cache =>
                cache.addAll([
                    '.',
                    'index.html',
                    'config.yml',
                    'app.css',
                    'app.js',
                    'vendors/vue.min.js',
                    'vendors/js-yaml.min.js',
                    'vendors/font-awesone.min.css',
                    'vendors/bulma.min.css',
                    'assets/logo.png',
                    'webfonts/raleway/raleway-v14-latin-regular.woff',
                    'webfonts/raleway/raleway-v14-latin-regular.woff2',
                    'webfonts/lato/lato-v16-latin-regular.woff',
                    'webfonts/lato/lato-v16-latin-regular.woff2',
                ])
            )
    )
})

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