Improved service worker for imports
This commit is contained in:
parent
f358ffbf7c
commit
55adb9adef
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user