Improve Cache Management for Service Worker Scripts

The HTTP cache will be ignored when requesting updates to the service worker. Requests for importScripts will still go through the HTTP cache. But this is just the default. A new registration option, ServiceWorkerRegistration.updateViaCache is available that offers control over this behavior.

Comments

Previously, HTTP requests that checked for updates to the service worker were fulfilled by the HTTP cache by default. If a Cache-Control header was inadvertently set on a service worker, then service worker updates could be delayed.

Documentation

Specification

Editor's draft

Status in Chromium

Blink>ServiceWorker


Enabled by default (tracking bug) in:

  • Chrome for desktop release 68
  • Chrome for Android release 68
  • Android WebView release 68
  • Opera release 55
  • Opera for Android release 55

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • Shipped
  • In development
  • No public signals
  • Positive

Owners

Last updated on 2018-05-31