Improved push conditions

This commit is contained in:
2017-11-25 14:11:55 +01:00
parent 85a26a5c5b
commit 81ffe05834
2 changed files with 4 additions and 8 deletions

View File

@ -211,14 +211,8 @@ class MyServiceWorker {
prefetchFullPage(url: string) {
let fullPage = new Request(url.replace("/_/", "/"))
// Disable HTTP/2 push responses
let headers = new Headers({
"X-Source": "service-worker"
})
let fullPageRefresh = fetch(fullPage, {
credentials: "same-origin",
headers
credentials: "same-origin"
}).then(response => {
// Save the new version of the resource in the cache
let cacheRefresh = caches.open(this.cache.version).then(cache => {