Closed mglaman closed 1 month ago
Looks like this problem was attempted to workaround here:
isWhitelisted = url.pathname.substr(0, prefix.length) === prefix && url.hostname === self.location.hostname;
isBlacklisted = url.pathname.match(/\.wasm$/i)
|| staticUrls.includes(url.pathname)
|| (this.exclude.findIndex(exclude => url.pathname.substr(0, exclude.length) === exclude) > -1)
|| false;
@mglaman
That's something Patricio and I have been going over. We need away to get through the service worker and put a request all the way through to the actual server in some cases.
Are you suggesting we remove the fetch
call alltogether, or use respondWith
instead of return
?
Remove the fetch or use respondWith. I'd opt for full removal and allow normal browser behavior
Per https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent, event listeners for
FetchEvent
should return responses usingrespondWith
or do nothing. The code usesrespondWith
for the PHP response, but then there is anelse
and afetch
performed. This is doubling the request.Need to remove