Problem/Motivation

Even when a URL is configured as excluded, the service worker still intercepts the request.
Although the URL does not appear under “Intercepted URLs” in browser storage, the service worker continues listening to and acting on the request in the background.

In my case, this resulted in broken or partial responses because the service worker attempted to intercept a menu endpoint that had a very long response time. This led to Firefox showing NS_BINDING_ABORTED errors - not because of Firefox itself, but because the service worker was prematurely aborting or interfering with the request.

The core issue is that excluded endpoints are not truly bypassed; they continue to pass through the service worker’s fetch handler, leading to unexpected behaviour and corrupted data.

Steps to reproduce

  • Create an endpoint that has a very long response time (e.g. a menu callback or any slow API response).
  • (In my setup this was on a Drupal site using the Domain module.)
  • Load a page that triggers a request to this slow endpoint — observe that the service worker attempts to intercept it, which may result in partial/broken data or console errors.
  • Add this endpoint to the PWA module’s excluded paths.
  • Reload the page.
    Even though the URL now appears as excluded, the service worker still intercepts it and continues producing errors or serving broken data.
    In Firefox you may see NS_BINDING_ABORTED or similar warnings, but the underlying issue is that the service worker keeps handling the request instead of bypassing it entirely.

Proposed resolution

Modify the service worker fetch handler so that when a URL matches the "excluded" rules, the service worker does not intercept the request at all.

The patch replaces the call to networkWithCacheFallback() with an early return, allowing the browser to handle the request natively.

Remaining tasks

Review patch
Test coverage in additional browsers (Chrome/Safari)
Commit / merge

User interface changes

None

API changes

None

Data model changes

None

Comments

oscarclement created an issue. See original summary.

oscarclement’s picture

Component: Code » pwa_service_worker