API primers
Google Developers Logo

Progressive Web App Dev Summit

June 20-21, Amsterdam, NL - Learn more

Introduction to Service Worker

Rich offline experiences, periodic background syncs, push notifications—functionality that would normally require a native application—are coming to the web. Service workers provide the technical foundation that all these features will rely on.

  1. Introduction to Service Worker
  2. Service Worker Lifecycle
  3. Prerequisites
  4. Register a Service Worker
  5. Install a Service Worker
  6. Cache and Return Requests
  7. Update a Service Worker
  8. Rough Edges and Gotchas
  9. Learn More; Get Help

Push and Notifications

Push messaging allows developers to engage users by providing timely and customized content outside the context of the web page. Push and Notification are different, but complementary, functions: a push is the action of the server supplying message information to a service worker; a notification is the action of the service worker sending the information to a user.

  1. Push and Notifications
  2. Register for push messages
  3. Display a Notification
  4. On the server: sending notifications

Promises

Promises simplify deferred and asynchronous computations. A promise represents an operation that hasn't completed yet.

  1. Promises

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. For details, see our Terms of Service.