start_url fetched via an "offline" SW not considered good enough
See original GitHub issueProvide the steps to reproduce
- Run LH on https://ondras.github.io/sw/
What is the current behavior?
start_url does not respond with a 200 when offline. The start_url did respond, but not via a service worker.
What is the expected behavior?
This configuration shall be considered okay.
The problem is related to the SW’s caching strategy. The current worker works online-first, i.e. it always tries to fetch the resource. It looks like it succeeds, even when “simulating offline in Lighthouse”, so the reply is not considered via a service worker.
If I change the if (cached)
implementation to simply return cached
(not trying any network interatction), Lighthouse works correctly.
Environment Information
- Affected Channels: DevTools
- Lighthouse version: 5.5, 5.7
- Chrome version: 79, 81
- Operating System: Linux
Issue Analytics
- State:
- Created 4 years ago
- Reactions:24
- Comments:17 (2 by maintainers)
Top Results From Across the Web
ServiceWorkers and Offline Browsing - nystudio107
The offline page just specifies a fallback page to use if they are offline, but they haven't visited any pages, so nothing is...
Read more >Caching - web.dev
Cache storage is a powerful tool. It makes your apps less dependent on network conditions. With good use of caches you can make...
Read more >Service Worker (sw.js) should always return offline.html ...
It solves the offline issue for any resources while there is no network connection, but now there's no access (via fetch) to the...
Read more >Pwa "The Start_Url Did Respond, But Not Via A Service Worker."
Lighthouse : starturl fetched via an offline SW not considered good enough. Created on when offline. The starturl did respond but not via...
Read more >Offline-Capable Progressive Web Apps for the Modern Web
Native applications are great - they allow a user to easily discover a brand through an app store they are familiar with, are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fantastic news! Any idea when this will be integrated in to Chrome?
fixed in #11745