We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b469bb commit c78a513Copy full SHA for c78a513
sw.js
@@ -61,8 +61,13 @@ self.addEventListener('fetch', event => {
61
event.respondWith(
62
caches.open(RUNTIME).then(cache => {
63
return caches.match(event.request).then(cachedResponse => {
64
+ // Under HSTS, unsecure resources response 307 redirect which broke cache.
65
+ var fixedUrl = event.request.url.replace('http://', '//')
66
// cache busting
- var fetchPromise = fetch(`${event.request.url}?${Math.random()}`, {cache: "no-store"})
67
+ var fetchPromise = fetch(`${event.request.url}?${Math.random()}`, {
68
+ cache: "no-store",
69
+ redirect: "follow"
70
+ })
71
.then(networkResponse => {
72
var resUrl = networkResponse.url
73
cache.put(event.request, networkResponse.clone())
0 commit comments