Allow fetchpriority=high
to be added to IMG
when it is the LCP element on desktop and mobile with other viewport groups empty
#1710
Labels
[Plugin] Image Prioritizer
Issues for the Image Prioritizer plugin (dependent on Optimization Detective)
[Plugin] Optimization Detective
Issues for the Optimization Detective plugin
[Type] Enhancement
A suggestion for improvement of an existing feature
Milestone
Image Prioritizer currently removes or doesn't add
fetchpriority=high
to anIMG
unless every viewport group is populated and each has an LCP element with the same XPath. I think this may be too conservative, especially since many sites may get very few phablet and tablet visitors meaning those URL Metric groups never get populated. I think we should perhaps align with what we're now doing for lazy-loading (#1604), where it does so if the narrowest viewport group (i.e. mobile) and the widest viewport group (i.e. desktop) both are populated. In the same way, if the mobile viewport group and the desktop viewport group both have the same LCP element (i.e. the same XPath) then we can in this case addfetchpriority=high
to theIMG
itself. Naturally, if the phablet and/or tablet viewport groups are also populated and they record a different LCP element, thenfetchpriority=high
should still be omitted.In practice this won't really impact most visitors since the
fetchpriority=high
preload links area being added for each populated viewport group, but if there were no URL Metrics gathered for phablet/tablet and there is a shared LCP element on mobile & desktop, then there would not be any preload link for the phablet/tablet device. In this case, the presence offetchpriority=high
on theIMG
itself would ensure they still get a performance improvement. This is also especially important for the case of optimizingPICTURE
elements which have art-directedSOURCE
images (withmedia
attributes), in which case adding preload links is not feasible.Previously discussed at #1707 (comment).
The text was updated successfully, but these errors were encountered: