Image strategies are never used. Regression in #3074285 The offline page is not displayed

Created on 9 June 2023, almost 2 years ago
Updated 10 August 2023, over 1 year ago

Problem/Motivation

In #3074285: The offline page is not displayed β†’ the following code was introduced.

@@ -377,6 +379,10 @@ self.addEventListener('fetch', function (event) {
     if (isCacheableAsset(url)) {
       event.respondWith(makeRequest.staleWhileRevalidate(event.request));
     }
+    else if (!isCacheableAsset(url)) {
+      //this networkWithCacheFallback dont work with excluded path.
+      event.respondWith(makeRequest.networkWithCacheFallback(event.request));
+    }
 
     // Check for save-data Header and avoid caching when present.
     else if (isImageUrl(url)) {

The last line will never be called, because one of the two conditions above will always match.

Steps to reproduce

Proposed resolution

Move the new code blow the else if (isImageUrl(url)) {...} code block.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany luenemann SΓΌdbaden, Germany

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024