mirror of
https://github.com/bastienwirtz/homer.git
synced 2024-11-07 16:54:00 +01:00
d819cf5c15
Signed-off-by: Felix Bartels <felix@host-consultants.de>
33 lines
1.0 KiB
JavaScript
33 lines
1.0 KiB
JavaScript
self.addEventListener('install', event => {
|
|
event.waitUntil(
|
|
caches
|
|
.open('homer')
|
|
.then(cache =>
|
|
cache.addAll([
|
|
'.',
|
|
'index.html',
|
|
'config.yml',
|
|
'app.css',
|
|
'app.js',
|
|
'vendors/js-yaml.min.js',
|
|
'assets/logo.png',
|
|
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css',
|
|
'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css',
|
|
'https://fonts.googleapis.com/css?family=Lato|Raleway&display=swap',
|
|
'https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js',
|
|
])
|
|
)
|
|
)
|
|
})
|
|
|
|
self.addEventListener('fetch', event => {
|
|
event.respondWith(
|
|
caches.match(event.request).then(response => {
|
|
if (response) {
|
|
return response;
|
|
}
|
|
return fetch(event.request);
|
|
})
|
|
);
|
|
});
|