/serviceworker-fetch-abort

Example showing how to abort fetch requests in a Service Worker

Primary LanguageJavaScript

serviceworker-fetch-abort

This test/exmple shows how to abort fetch requests in a Service Worker by passing a new groupId in the URL. Useful for cancelling a large number of requests that are either queued in the browser or already in-flight

Usage

  1. python3 -m http.server
  2. http://localhost:8000/
  3. Open browser network inspector and console
  4. Click "Reload" before requests finish to make Service Worker abort the in-flight requests.