Service Worker Playground

If you're wondering what this is about, head to the associated repo for an explanation.

This page is static and won't change. It registers a service worker hosted at /sw.js, which serves dynamic content (time-based).

The logic within the service worker is dead simple: replace placeholder text on this page with a message generated from within the service worker. The service worker is built so that the message it templates on the page contains the timestamp at which it is fetched from the server.

SW Controls

Register the service worker at /sw.js:

Registration status: unregistered

Update the service worker with a fresh version:

Un-register the service worker:

Target For Service Worker

Below is our target for the service worker to replace. When nothing is installed you should see SERVICE_WORKER_PLEASE_.... When the service worker is activated, it will replace this placeholder with the time at which it was fetched from the server.

SERVICE_WORKER_PLEASE_REPLACE_ME