-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The analyze-loading-optimization command doesn't currently account for fetchpriority=high being added for images via preload links:
wpp-research/cli/commands/analyze-loading-optimization.mjs
Lines 418 to 430 in 8163be1
| // Obtain fetchPriorityCount, lcpImageMissingFetchPriority, fetchPriorityInsideViewport, and fetchPriorityOutsideViewport. | |
| const fetchpriorityHighImages = document.body.querySelectorAll( | |
| 'img[fetchpriority="high"]' | |
| ); | |
| for ( const img of fetchpriorityHighImages ) { | |
| analysis.fetchPriorityCount++; | |
| if ( isElementInViewport( img ) ) { | |
| analysis.fetchPriorityInsideViewport++; | |
| } else { | |
| analysis.fetchPriorityOutsideViewport++; | |
| } | |
| } |
This is done by the Image Prioritizer plugin especially when the same image is not LCP on mobile and desktop, as in this case adding fetchpriority=high could be incorrect for one or the other.
felixarntz
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request