Removed http/2 push for service worker prefetches

This commit is contained in:
2017-11-11 19:24:47 +01:00
parent b0a30cdbfa
commit 97dfcf43ae
2 changed files with 12 additions and 1 deletions

View File

@ -211,8 +211,14 @@ 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"
credentials: "same-origin",
headers
}).then(response => {
// Save the new version of the resource in the cache
let cacheRefresh = caches.open(this.cache.version).then(cache => {