sitespeedio / coach

Clear Eyes. Full Hearts. Can’t Lose.
MIT License
1.21k stars 64 forks source link

Coach says my requests on a domain are HTTP 1, but it's HTTP 2 #325

Closed kazazor closed 5 years ago

kazazor commented 5 years ago

I would like to report a bug.

Command:

docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:8.0.2-plus1 https://www.ynet.co.il -n 1

Then you'll see for the URL https://www.ynet.co.il/home/0,7340,L-8,00.html that Coach says:

The page has 1 domain(s) that serves more than 30 requests. images1-ynet-prod.azureedge.net got 173 requests. Improve performance by sharding those or move to HTTP/2.

But if you open dev tools on this URL you'll see that all the requests to images1-ynet-prod.azureedge.net are marked as h2: in the dev tools filter just write: domain:images1-ynet-prod.azureedge.net

screen shot 2019-01-22 at 23 16 59

More info

Version: 8.0.2 (but noticed also on 8.0.0)

soulgalore commented 5 years ago

Hey @kazazor can you show me how you run? When I checked right now in master bin/sitespeed.js https://hello.com -n 1 it looks right?

screen shot 2019-01-22 at 9 22 41 pm

Best Peter

kazazor commented 5 years ago

Sorry for being misleading here, hello.com was just an example so I won't write the website I'm using personally :) Didn't actually checked vs that URL..

The user name and password I shared with you are still valid so you can check it out using them with the example I provided you.

soulgalore commented 5 years ago

Meh https://www.sitespeed.io/documentation/sitespeed.io/bug-report/#explain-how-to-reproduce-your-issue :)

I'll check first thing tomorrow.

kazazor commented 5 years ago

Sorry for that :/ As you know I usually do, but I can't share this one :/

I'll try to find another open website that has this issue in order to show it here.

kazazor commented 5 years ago

💣 found one!

Command:

docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:8.0.2-plus1 https://www.ynet.co.il -n 1

Then you'll see for the URL https://www.ynet.co.il/home/0,7340,L-8,00.html that Coach says:

The page has 1 domain(s) that serves more than 30 requests. images1-ynet-prod.azureedge.net got 173 requests. Improve performance by sharding those or move to HTTP/2.

But if you open dev tools on this URL you'll see that all the requests to images1-ynet-prod.azureedge.net are marked as h2: in the dev tools filter just write: domain:images1-ynet-prod.azureedge.net

screen shot 2019-01-22 at 23 16 59
soulgalore commented 5 years ago

Thanks for taking the time to find another URL @kazazor !!! Ok, the implementation was done before h2 was a thing, so it must be a bug in how the Coach uses the Resource Timing API, let me try to fix that ASAP.

soulgalore commented 5 years ago

Hmm that example page is an AMP page, I wonder if the do something strange there. According to the Resource Timing API the page is a HTTP/1: window.performance.getEntriesByType('navigation')

gives

screen shot 2019-01-22 at 23 39 35

but let me try your original URL.

kazazor commented 5 years ago

Hmm that's strange, sorry that my alternative URL sucks haha

I just checked my original URL (which I cannot share) and I see the value nextHopProtocol: "h2" but still gets the error from Coach.

soulgalore commented 5 years ago

Yeah I see that too, but the login page (where the add login/pw) is http/1 so maybe the Coach gets it wrong there somewhere.

kazazor commented 5 years ago

Might be, even that in the message Coach specifies the domain on the main app which is different than the login URL.

In the meantime, I'll try to find another good open URL to share here so others could give it a try too.

soulgalore commented 5 years ago

When I checked this a couple of days ago I got http2, I wonder if the problem when you test could be that the page hadn't loaded (just guessing now).

kazazor commented 5 years ago

I don't believe that's the case since it did finish loading and I got full results

kazazor commented 5 years ago

I just ran it using 8.0.4 and I don't see this suggestion anymore. I'll close it for now and reopen if it will appear again.