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