Closed benschwarz closed 1 month ago
It's late where I am now, I'll prepare a fix tomorrow during my day.
Thank you @benschwarz for creating the issue. Let me know If you need some help!
@benschwarz I made a PR that maybe fixes it, if you have please check if it works for you :)
Hey @soulgalore, apologies for the delay. I'll be wrapped up in something else until next week. I suspect your fix is all that's required, but I want to first check if there's any strange side effects and update the test suite so that it's covered in future.
I think that should be safe. We could add a test example, I can do that later on.
On a page with verified early hints requests we can see requests initiated by early hints:
Running that page with
npx browsertime --chrome.collectPerfLog -n 1 $URL
and inspecting the HAR we can see:.css
requests.css
stylesheetsInspecting the devtools log I can see that the request made to
master-cb9e9afd3d.css
(request ID: 87395.8) has the expectedNetwork.requestWillBeSent
,Network.responseReceived
,Network.dataReceived
,Network.loadingFinished
events.Curiously, I noticed that both
fromDiskCache
andfromEarlyHints
are bothtrue
on theNetwork.responseReceived
request:In checking
entryFromResponse.js
we can see thatfromDiskCache
and__servedFromCache
are used to gate functionality:https://github.com/sitespeedio/chrome-har/blob/2006c4dce0971180b023dda3fe7c0cd085efeadf/lib/entryFromResponse.js#L93
https://github.com/sitespeedio/chrome-har/blob/2006c4dce0971180b023dda3fe7c0cd085efeadf/lib/entryFromResponse.js#L180
I suspect we'll want to check request entries to see if they've been loaded by early request hints.
In case we need it, there's a
Network.responseReceivedEarlyHints
event.