ServiceWorker.js: drop all headers from request that could trigger a HTTP 304 response
This commit contains a temporary workaround to deal with a bug in Desktop Safari
that prevents a successful resource integrity check when
a resource is loaded via the service worker
and the webpage forces cache revalidation (like we do).
When the resource is not modified, the server responds with a HTTP "304 -
Not modified" response. However, then Safari (supposedly) tries to check
the content from this response against the integrity hash instead of
the actual cached content. Obviously, this is pointless, since a HTTP
304 doesn't contain any content, because that would defer the entire
point, right? Hence, the integrity check won't ever succeed.. :-/
Therefore, we're now removing all headers from the request that could trigger
such a response. Addmitedly, that's less then ideal, since it effectiviely breaks
caching for all resources with an integrity check. However, these resources are
typically small and this patch is intended to be temporary.
ServiceWorker.js: drop all headers from request that could trigger a HTTP 304 response
This commit contains a temporary workaround to deal with a bug in Desktop Safari that prevents a successful resource integrity check when a resource is loaded via the service worker and the webpage forces cache revalidation (like we do).
When the resource is not modified, the server responds with a HTTP "304 - Not modified" response. However, then Safari (supposedly) tries to check the content from this response against the integrity hash instead of the actual cached content. Obviously, this is pointless, since a HTTP 304 doesn't contain any content, because that would defer the entire point, right? Hence, the integrity check won't ever succeed.. :-/
Therefore, we're now removing all headers from the request that could trigger such a response. Addmitedly, that's less then ideal, since it effectiviely breaks caching for all resources with an integrity check. However, these resources are typically small and this patch is intended to be temporary.