diff --git a/packages/service-worker/worker/src/assets.ts b/packages/service-worker/worker/src/assets.ts index 90e639d651..bfb8a66413 100644 --- a/packages/service-worker/worker/src/assets.ts +++ b/packages/service-worker/worker/src/assets.ts @@ -393,8 +393,8 @@ export abstract class AssetGroup { // reasons: either the non-cache-busted request failed (hopefully transiently) or if the // hash of the content retrieved does not match the canonical hash from the manifest. It's // only valid to access the content of the first response if the request was successful. - let makeCacheBustedRequest: boolean = networkResult.ok; - if (makeCacheBustedRequest) { + let makeCacheBustedRequest: boolean = !networkResult.ok; + if (networkResult.ok) { // The request was successful. A cache-busted request is only necessary if the hashes // don't match. Compare them, making sure to clone the response so it can be used later // if it proves to be valid.