LCP Image Preload Improvement Suggestion
-
Hi Frank,
Right now the LCP image field accepts a url which in a proper design will preload either the image served on a desktop or an image served on a mobile (depending which size will somebody use in the field).
There is no way to cover both, the way it is now unless it is the same url. However by accepting an ID and modifying a bit the output code it can properly preload any image served inside an
tag by wordpress which has imagesrcset and imagesizes.
The output shoud be slightly be modified like this
<link rel="preload" href="..." as="image" imagesrcset="..." imagesizes="..." fetchpriority="high">
this is tested on both mobile and desktop and the correct image size is preloaded and chrome doesn’t throw any warning at the console for preloading a non used image.
Please give it a try,
Thank you in advance
- The topic ‘LCP Image Preload Improvement Suggestion’ is closed to new replies.