You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Make use of the Request cache mode where we can.
// Reload skips the HTTP cache for outgoing requests and updates
// the cache with the returned response.
requestOptions.cache='reload';
}else{
constparsedURL=newURL(url,location);
// This is done so the minifier can mangle 'global.encodeURIComponent'
const_encodeURIComponent=encodeURIComponent;
parsedURL.search+=(parsedURL.search ? '&' : '')+
_encodeURIComponent(`_workbox-cache-bust`)+'='+
_encodeURIComponent(this._revision);
url=parsedURL.toString();
}
returnnewRequest(url,requestOptions);
}
to cache-bust an outgoing request to populate the precache via setting the cache property to 'reload', with some feature detection to fall back to setting a cache-bust query parameter if needed.
In v4, we stopped that (partly because we end up using that query parameter as the actual cache key, so it's somewhat simpler to also use it in the outgoing request.)
We can change that, though, and potentially just set cache = 'reload' again. I did a quick check and it's supported in all modern browsers; you can check with:
I'm spinning this off of #2143 (comment)
In Workbox v3, we used code like
workbox/packages/workbox-precaching/models/PrecacheEntry.mjs
Lines 54 to 77 in d27aafb
to cache-bust an outgoing request to populate the precache via setting the
cache
property to'reload'
, with some feature detection to fall back to setting a cache-bust query parameter if needed.In v4, we stopped that (partly because we end up using that query parameter as the actual cache key, so it's somewhat simpler to also use it in the outgoing request.)
We can change that, though, and potentially just set
cache = 'reload'
again. I did a quick check and it's supported in all modern browsers; you can check with:This might be done as part of a refactoring that would clear up some of our naming in
workbox-precache
aroundcacheKey
andurl
.CC: @philipwalton
The text was updated successfully, but these errors were encountered: