question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

start_url fetched via an "offline" SW not considered good enough

See original GitHub issue

Provide the steps to reproduce

  1. 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:closed
  • Created 4 years ago
  • Reactions:24
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
JacobDBcommented, Dec 15, 2020

Fantastic news! Any idea when this will be integrated in to Chrome?

4reactions
brendankennycommented, Dec 15, 2020

fixed in #11745

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found