homer/worker.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-02-18 09:23:20 +01:00
self.addEventListener('install', event => {
event.waitUntil(
caches
.open('homer')
.then(cache =>
cache.addAll([
'.',
'index.html',
'config.yml',
'app.css',
'app.js',
2020-01-13 06:45:37 +01:00
'vendors/vue.min.js',
'vendors/js-yaml.min.js',
2020-01-13 06:45:37 +01:00
'vendors/font-awesone.min.css',
'vendors/bulma.min.css',
'assets/logo.png',
2020-01-13 06:45:37 +01:00
'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',
2019-02-18 09:23:20 +01:00
])
)
)
})
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request).then(response => {
if (response) {
return response;
}
return fetch(event.request);
})
);
});