Have questions about images on the web? Tweet your questions to @ChromiumDev with #AskChrome and we'll answer the top questions in our next #AskChrome episode on YouTube.

Cache Contains start_url From Manifest

Overview

Ensures that a progressive web app properly launches from a mobile device homescreen while offline.

Recommendations

  1. Define a start_url property in your manifest.json file.
  2. Ensure that your service worker properly caches a resource that matches the value of start_url.

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

More information

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 start_url property.

This audit parses the value of start_url from 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 start_url 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 matches start_url, but your service worker redirects the request to a non-existent resource.

Feedback

Was this page helpful?
Yes
What was the best thing about this page?
It helped me complete my goal(s)
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
It had the information I needed
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
It had accurate information
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
It was easy to read
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
Something else
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
No
What was the worst thing about this page?
It didn't help me complete my goal(s)
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
It was missing information I needed
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
It had inaccurate information
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
It was hard to read
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.
Something else
Thank you for the feedback. If you have specific ideas on how to improve this page, please create an issue.