Registers a service worker that controls page and start_url

Registering a service worker is the first step towards enabling the following progressive web app features:

  • Offline
  • Push notifications
  • Add to homescreen

Learn more in Service workers and the Cache Storage API. Lighthouse flags pages that don't register a service worker:

Lighthouse audit showing site doesn't register a service worker
Site doesn't register a service worker.

How this audit fails

Lighthouse checks if the Chrome Debugger returns a service worker version. If it does not, the audit fails.

Each PWA audit is weighted equally in the Lighthouse PWA Score, with the exception of three manual audits: Site works cross-browser, Page transitions don't feel like they block on the network, Each page has a URL. Learn more in The Progressive Web App score.

Recommendations

Registering a service worker involves only a few lines of code, but the only reason you'd use a service worker is to implement one of the progressive web app features outlined above. Implementing those features requires more work. For more help on caching files for offline use, see What is network reliability and how do you measure it?.

For enabling push notifications or "add to homescreen", complete the following step-by-step tutorials and then use what you learn to implement the features in your own app:

More information

Page doesn't register a service worker audit source

Last updated: Improve article