← Back to release summary

Extend byte-for-byte update check to all service worker importScripts() resources

Category
Service Worker
Type
New or changed feature
Status
Enabled by default (Chrome 78)
Intent stage
Evaluate readiness to ship

Summary

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).

Standards & signals

Docs: https://docs.google.com/document/d/1p_2axsp96GfME5lE4Zd-p5ei80-9OD_brFUjLYyN8B0/edit#heading=h.gpfhohh5a3pf

Explainers: https://w3c.github.io/ServiceWorker/#update-algorithm

View on chromestatus.com