This implements byte-for-byte update check for service worker scripts imported by importScripts().

Motivation

Currently, service workers update only when the service worker main script has changes. This does not only conform to the latest spec, but also this is forcing web developers to invest time for workarounds, such as adding hashes to the imported script’s urls to make some update to the main script. Also, some sites are trying to import scripts always from the network by adding random suffix to the url due to this wrong update behavior of imported scripts, but we are planning to deprecate it soon since it can negatively impact the workers’ performance (“Intent to Deprecate and Remove: importScripts() of new scripts after service worker installation” https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/a6P-niHWgF4/CtJEHCnKDwAJ).

Documentation

Specification

Editor's draft

Status in Chromium

Blink>ServiceWorker


Enabled by default (tracking bug) in:

  • Chrome for desktop release 78
  • Chrome for Android release 78
  • Android WebView release 78

Consensus & Standardization

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

Owners

Search tags

service worker, service, worker, importScripts, update, byte for byte,

Last updated on 2020-11-09