lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

Litehouse reporting not using http2 when content delivered using http3

Open christopherdarling opened this issue 3 years ago • 18 comments

Provide the steps to reproduce

  1. Run LH on https://www.google.com/?gws_rd=ssl

What is the current behavior?

Lighthouse reports that http/2 is not in use

What is the expected behavior?

Chrome network tools shows H3-29 / H3-Q050 (on my site) and reports the URL as using http/1.1

Environment Information

  • Affected Channels:
  • Lighthouse version:Lighthouse 7.0.0 Chrome Extension
  • Chrome version: 89.0.4389.90
  • Node.js version:
  • Operating System:

Related issues Maybe https://github.com/GoogleChrome/lighthouse/issues/9788

christopherdarling avatar Mar 24 '21 16:03 christopherdarling

If this is the extension, then this problem is likely #7326, but the "Use HTTP/2" audit won't appear when you get a report from the extension, so I'm not sure where you're seeing Lighthouse say that h2 is not in use.

Also running the listed url (https://www.google.com/?gws_rd=ssl) via the extension now, it actually does use h2, so the audit would have passed if it were present.

Chrome network tools shows H3-29 / H3-Q050 (on my site) and reports the URL as using http/1.1

You mention your site, so are you actually seeing this problem on a different URL? If that's the case and you're seeing the http/1.1 requests in your server logs or something, #7326 is the issue.

It would be easier to tell what's going on with

  • the url you're testing
  • the exact unexpected result you're seeing in the lighthouse report

brendankenny avatar Mar 24 '21 23:03 brendankenny

Sorry my mistake this wasn't done in the chrome extension it was from the lighthouse tab in devtools.

Will post the other details requested tomorrow when back at my desk

christopherdarling avatar Mar 24 '21 23:03 christopherdarling

Please see below two screenshots showing the issue on google.com, these are from Lighthouse in Google Devtools.

Lighthouse report, as you can see http/1.1 image

Network tab, the top request states H3 image

christopherdarling avatar Mar 25 '21 09:03 christopherdarling

I am also experiencing this same issue.

Using Lighthouse 9.1.0 (Node command line tool): lighthouse https://www.completepropertysuccess.co.uk

The generated Lighthouse report instructs me to use HTTP/2 instead of HTTP/1.1, however when I visit this website in my browser, the network tab of developer tools says that the response is sent via HTTP/3 protocol.

Report details: Captured at Dec 6, 2021. Emulated Moto G4 with Lighthouse 9.1.0 (Node command line tool) - default settings. Using Chromium 96.0.4664.45 with cli

brybrant avatar Dec 06 '21 16:12 brybrant

I can't reproduce this on either page, is this happening on every Lighthouse run?

adamraine avatar Dec 07 '21 00:12 adamraine

Yes, this happens on every Lighthouse run.

Also I just tried using Lighthouse within Google Chrome DevTools and it gives me the same error: "Use HTTP/2" - then I switch to the 'Network' tab and see the Protocol is h3 🙁

image

image

Report details: Captured at Dec 7, 2021. Emulated Moto G4 with Lighthouse 8.5.0 (Google Chrome DevTools) - default settings. Using Google Chrome Version 96.0.4664.93 (Official Build) (64-bit)

brybrant avatar Dec 07 '21 18:12 brybrant

I couldn't reproduce this on 50+ attempts :(

Can you provide the contents of your ./latest-run folder after running lighthouse https://www.completepropertysuccess.co.uk -GA? Preferably as a gist.

adamraine avatar Dec 07 '21 19:12 adamraine

Here you go; https://gist.github.com/brybrant/b54c5c05f4d0feef9e7ce603b2010232

brybrant avatar Dec 08 '21 14:12 brybrant

Thanks, this helps narrow down where the problem lies. It looks like Chrome is using http/1.1 as the protocol version in network events.

I took a peak at the network events on my end, and they were using h2 instead of h3. So I can reproduce an incorrect protocol version, but not enough to fail the audit 😕 .

This looks like a Chrome bug.

adamraine avatar Dec 08 '21 17:12 adamraine

I just did another test using the Lighthouse browser extension for Firefox and your suspicion seems correct; the report does not claim that the website is using HTTP/1.1

brybrant avatar Dec 08 '21 18:12 brybrant

I just did another test using the Lighthouse browser extension for Firefox

This is equivalent to the Chrome extension and doesn't suggest a difference in behavior between FF/Chrome–the extension just uses the PSI API, which runs a special build of headless Chrome on an external server.

@brybrant Some questions:

  1. What is the output from this command on your machine?
curl https://www.completepropertysuccess.co.uk/ -I

curl https://www.completepropertysuccess.co.uk/ -I  -A "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4695.0 Mobile Safari/537.36 Chrome-Lighthouse"
  1. Does Mobile/Desktop option in Lighthouse DevTools panel make a difference?

connorjclark avatar Dec 08 '21 23:12 connorjclark

1(a). Output for first command:

HTTP/2 200
content-type: text/html; charset=utf-8
last-modified: Tue, 07 Dec 2021 18:42:33 GMT
accept-ranges: bytes
content-length: 29898
date: Thu, 09 Dec 2021 09:44:56 GMT
server: LiteSpeed
vary: User-Agent
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
cache-control: max-age=86400, public, must-revalidate
alt-svc: h3=":443"; ma=2592000, h3-29=":443"; ma=2592000, h3-Q050=":443"; ma=2592000, h3-Q046=":443"; ma=2592000, h3
-Q043=":443"; ma=2592000, quic=":443"; ma=2592000; v="43,46"

1(b). Output for second command:

HTTP/2 200
content-type: text/html; charset=utf-8
last-modified: Tue, 07 Dec 2021 18:42:33 GMT
accept-ranges: bytes
content-length: 29898
date: Thu, 09 Dec 2021 09:46:00 GMT
server: LiteSpeed
vary: User-Agent
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
cache-control: max-age=86400, public, must-revalidate
alt-svc: h3=":443"; ma=2592000, h3-29=":443"; ma=2592000, h3-Q050=":443"; ma=2592000, h3-Q046=":443"; ma=2592000, h3
-Q043=":443"; ma=2592000, quic=":443"; ma=2592000; v="43,46"
  1. Running Lighthouse with 'Desktop' mode selected in Google Chrome DevTools does not report that the website is using HTTP/1.1 - however, using Lighthouse Node CLI with command lighthouse https://www.completepropertysuccess.co.uk/ --preset=desktop still claims that the website is using HTTP/1.1

brybrant avatar Dec 09 '21 10:12 brybrant

  • facing similar issue, lighthouse report showing using HTTP/1.1 when run via cypress and lighthouse though its not shown in diagnostics when running via chrome extension

image

  • When accessing the site in chrome image

rupeshpadhye avatar Feb 09 '22 04:02 rupeshpadhye

I have the same issue. @adamraine.

Lighthouse reports that I am using HTTP/1.1, when protocol is reported as HTTP3 (h3).

image

image

Dode123 avatar Feb 28 '22 22:02 Dode123

Thank you! Looking forward to seeing the solution 🙏🏻.

emperol2 avatar May 08 '22 05:05 emperol2

@hecktarzuli that screenshot is not from Lighthouse, but WebPageTest and its network logging.

Do you see the issue when using Lighthouse directly (chrome devtools or CLI), or from PSI?

connorjclark avatar May 02 '24 19:05 connorjclark

@connorjclark I removed the comment with the wrong screenshots. Yes this seems to happen in lighthouse too both local and via web.

Local image

Web (via Speedcurve) image

But hitting the site as a normal user, I get H3 image

Page Speed Insights doesn't say anything about it, but I also don't see anything about it in the Passed Tests either.

hecktarzuli avatar May 02 '24 19:05 hecktarzuli

Actually, it would seem this issue is inherent to H3 negotiation. I just cleared my local cache and re-hit our site, and sure enough the 1st hit was 1.1.

https://blog.cloudflare.com/speeding-up-https-and-http-3-negotiation-with-dns/

hecktarzuli avatar May 02 '24 19:05 hecktarzuli