Skip to content

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

@ondras

Description

@ondras

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions