Improved service worker for imports
This commit is contained in:
parent
f358ffbf7c
commit
55adb9adef
@ -163,7 +163,18 @@ 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/")) {
|
||||||
this.prefetchFullPage(url)
|
var prefetch = true
|
||||||
|
|
||||||
|
for(let pattern of EXCLUDECACHE.keys()) {
|
||||||
|
if(url.includes(pattern)) {
|
||||||
|
prefetch = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(prefetch) {
|
||||||
|
this.prefetchFullPage(url)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!refresh || !servedETag) {
|
if(!refresh || !servedETag) {
|
||||||
|
Loading…
Reference in New Issue
Block a user