Fix sw urls caching (#739)

* Fix sw urls caching

* Remove navigateFallback

* Syntax fix
This commit is contained in:
Andrey 2017-12-24 00:29:55 +02:00 committed by Paulus Schoutsen
parent b3ded276b5
commit cf4d867fa1

View File

@ -75,9 +75,7 @@ function generateServiceWorker(es6) {
});
const options = {
navigateFallback: '/',
navigateFallbackWhitelist:
[/^(?:(?!(?:static|api|frontend_latest|frontend_es5|local|service_worker.js|manifest.json)).)*$/],
directoryIndex: '',
dynamicUrlToDependencies: dynamicUrlToDependencies,
staticFileGlobs: [
baseRootDir + '/icons/favicon.ico',
@ -100,7 +98,7 @@ function generateServiceWorker(es6) {
handler: 'networkOnly',
},
{ // Get manifest and service worker from network.
urlPattern: '/(service_worker.js|manifest.json)',
urlPattern: '/(service_worker.js|service_worker_es5.js|manifest.json)',
handler: 'networkOnly',
},
{ // For rest of the files (on Home Assistant domain only) try both cache and network.