> [!CAUTION]
> **Caution:** PWA testing in Lighthouse is deprecated. For more information on its deprecation see [Chrome's updated Installability Criteria](https://developer.chrome.com/blog/update-install-criteria). For guidance on testing, refer to the [PWA documentation.](https://developer.chrome.com/docs/devtools/progressive-web-apps)

Registering a [service worker](https://web.dev/articles/service-workers-cache-storage)
is the first step towards enabling key [Progressive Web App (PWA)](https://web.dev/explore/progressive-web-apps#make-it-installable) features:

- Works offline
- Supports push notifications
- Can be installed to the device

Learn more in the [Service workers and the Cache Storage API](https://web.dev/articles/service-workers-cache-storage) post.

## Browser compatibility

All major browsers support service workers. See
[Browser compatibility](https://developer.mozilla.org/docs/Web/API/ServiceWorker#Browser_compatibility).

## How the Lighthouse service worker audit fails

[Lighthouse](https://developer.chrome.com/docs/lighthouse/overview)
flags pages that don't register a service worker:
![Lighthouse audit showing site doesn't register a service worker](https://developer.chrome.com/static/docs/lighthouse/pwa/service-worker/image/lighthouse-audit-showing-e099b7b47033f.png)

Lighthouse checks if the [Chrome Remote Debugging Protocol](https://github.com/ChromeDevTools/devtools-protocol)
returns a service worker version. If it doesn't, the audit fails.

> [!NOTE]
> **Note:** In the Lighthouse report UI the full PWA badge is given when you pass all of the audits in all of the PWA subcategories (**Fast and reliable** , **Installable** , and **PWA optimized**).

## How to register a service worker

> [!TIP]
> **Success:** [Workbox](https://developer.chrome.com/docs/workbox) is the recommended approach for adding service workers to websites because it automates a lot of boilerplate, makes it easier to follow best practices, and prevents subtle bugs that are common when using the low-level `ServiceWorker` API directly.

Registering a service worker involves only a few lines of code,
but the only reason you'd use a service worker
is to make it possible to implement one of the PWA features outlined above.
Actually implementing those features requires more work:

- To learn how to cache files for offline use, see the [What is network reliability and how do you measure it?](https://web.dev/articles/network-connections-unreliable) post.
- To learn how to make your app installable, see the [Make it installable](https://web.dev/articles/codelab-make-installable) codelab.
- To learn how to enable push notifications, see Google's [Adding Push Notifications to a Web App](https://codelabs.developers.google.com/codelabs/push-notifications).

## Resources

- [Source code for **Does not register a service worker that controls page and `start_url`** audit](https://github.com/GoogleChrome/lighthouse/blob/main/core/audits/service-worker.js)
- [Service Workers: an Introduction](https://developer.chrome.com/docs/workbox/service-worker-overview)
- [Service workers and the Cache Storage API](https://web.dev/articles/service-workers-cache-storage)
- [What is network reliability and how do you measure it?](https://web.dev/articles/network-connections-unreliable)
- [Make it installable](https://web.dev/articles/codelab-make-installable)
- [Adding Push Notifications to a Web App](https://codelabs.developers.google.com/codelabs/push-notifications)