Improved service worker for imports

This commit is contained in:
Eduard Urbach 2017-11-30 03:27:38 +01:00
parent f358ffbf7c
commit 55adb9adef

View File

@ -163,8 +163,19 @@ class MyServiceWorker {
// If the user requests a sub-page we should prefetch the full page, too. // If the user requests a sub-page we should prefetch the full page, too.
if(url.includes("/_/") && !url.includes("/_/search/")) { if(url.includes("/_/") && !url.includes("/_/search/")) {
var prefetch = true
for(let pattern of EXCLUDECACHE.keys()) {
if(url.includes(pattern)) {
prefetch = false
break
}
}
if(prefetch) {
this.prefetchFullPage(url) this.prefetchFullPage(url)
} }
}
if(!refresh || !servedETag) { if(!refresh || !servedETag) {
return Promise.resolve() return Promise.resolve()