-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core(preload-lcp-image): fix faulty request chain exclusion logic #14404
base: main
Are you sure you want to change the base?
Conversation
@@ -1797,45 +1797,8 @@ | |||
"displayValue": "", | |||
"details": { | |||
"type": "opportunity", | |||
"headings": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This delta here shows the new logic is WAI, as this image is directly requested by the main document.
For the smoke failure: added an additional issue to #14300 (comment) that I believe has come up in the past but I couldn't find written down anywhere. A dynamically-loaded image with That's what's causing the test to think that it was a single hop from html->image even though it's actually |
Should we just mark this audit n/a if the LCP element initiatorRequest is undefined, and just 100% defer to |
// this case for this audit. | ||
if (request.initiatorRequest) { | ||
// It's already discoverable from the main document, don't recommend it. | ||
if (initiatorPath.length <= mainResourceDepth + 1) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this +1 for the redirect request? What if there are multiple redirects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is addressing the first bullet point of #14300. The mainResourceDepth
variable accounts for the redirects.
Should it be a warning instead? I'm not sure how often and in what circumstances Chrome loses initiator info, but
|
return { | ||
score: ByteEfficiencyAudit.scoreForWastedMs(wastedMs), | ||
score: missingInitiator ? 0 : ByteEfficiencyAudit.scoreForWastedMs(wastedMs), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brendankenny should I be doing something else here?
ref #14300 (comment)