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
There are a couple of places where we default to checking response.ok to determine whether a given response is cacheable or not. (This can be overridden by workbox-cacheable-response, but we're talking about the defaults.)
response.ok is true iff 200 <= response.status <= 299. Unfortunately, there are some scenarios where we don't want to cache responses in that range, like when response.status === 206 (for partial content). Attempting to cache that type of response will fail as per the Cache Storage API.
Rather than go with response.ok && response.status !== 206 as the default criteria, I think we should just switch to response.status === 200 as the default, unless folks have a strong use case for caching other 2xx status responses by default. We'll continue to allow opting-in to custom cacheability criteria using workbox-cacheable-response.
The text was updated successfully, but these errors were encountered:
Library Affected:
workbox-core, workbox-strategies
There are a couple of places where we default to checking
response.ok
to determine whether a given response is cacheable or not. (This can be overridden byworkbox-cacheable-response
, but we're talking about the defaults.)response.ok
istrue
iff 200 <= response.status <= 299. Unfortunately, there are some scenarios where we don't want to cache responses in that range, like whenresponse.status === 206
(for partial content). Attempting to cache that type of response will fail as per the Cache Storage API.Rather than go with
response.ok && response.status !== 206
as the default criteria, I think we should just switch toresponse.status === 200
as the default, unless folks have a strong use case for caching other 2xx status responses by default. We'll continue to allow opting-in to custom cacheability criteria usingworkbox-cacheable-response
.The text was updated successfully, but these errors were encountered: