Ensures that a progressive web app properly launches from a mobile device homescreen while offline.
- Define a
start_urlproperty in your
- Ensure that your service worker properly caches a resource that matches
the value of
To learn the basics of adding apps to homescreens, see Add Your Web App to a User's Home Screen. This is a step-by-step, hands-on codelab in which you add "add to homescreen" functionality into an existing app. Use what you learn in this codelab to integrate "add to homescreen" functionality in your own app.
For more help on how to cache files with service workers for offline use, see the "How to pass the audit" section of the following Lighthouse doc: URL responds with a 200 when offline
When a progressive web app is launched from the homescreen of a mobile
device, the app opens on a specific URL. That URL is defined in the app's
manifest.json file as the
This audit parses the value of
manifest.json and then
ensures that a matching resource is cached in the service worker's cache.
If your service worker redirects
start_url requests, this audit
may produce inaccurate results.
One shortcoming of this audit is that it inspects the cache contents
directly, rather than asking the service worker to resolve the
request. This can produce a false negative result if your cache is missing
a resource that matches the exact value of
start_url, even though in
real scenarios the request resolves successfully because the service
worker redirects to another resource in the cache. Conversely, the audit can
produce a false positive result if your cache contains a resource that
start_url, but your service worker redirects the request to
a non-existent resource.
Was this page helpful?