Nextjs image preloading
Unanswered
Thrianta posted this in #help-forum
ThriantaOP
I'm getting mixed signals from the Nextjs docs and google lighthouse and have some confusion about image preloading. The nextjs docs state:
When to use preload:
- The image is the Largest Contentful Paint (LCP)
element.
- The image is above the fold, typically the hero image.
This is the case for my hero image, BUT the docs also state:
When not to use it:
When the fetchPriority property is used.
Now when i run my website through google lighthouse i get the optimization recommendation for my LCP image:
fetchpriority=high should be applied
This directly contradicts what is stated in the Nextjs docs. Now i know that lighthouse can be off sometimes and is mainly to give a general indication of performance, but still i would love someone elses input.
When to use preload:
- The image is the Largest Contentful Paint (LCP)
element.
- The image is above the fold, typically the hero image.
This is the case for my hero image, BUT the docs also state:
When not to use it:
When the fetchPriority property is used.
Now when i run my website through google lighthouse i get the optimization recommendation for my LCP image:
fetchpriority=high should be applied
This directly contradicts what is stated in the Nextjs docs. Now i know that lighthouse can be off sometimes and is mainly to give a general indication of performance, but still i would love someone elses input.
2 Replies
@Thrianta I'm getting mixed signals from the Nextjs docs and google lighthouse and have some confusion about image preloading. The nextjs docs state:
*When to use preload:
- The image is the Largest Contentful Paint (LCP)
element.
- The image is above the fold, typically the hero image.*
This is the case for my hero image, BUT the docs also state:
*When not to use it:
When the fetchPriority property is used.*
Now when i run my website through google lighthouse i get the optimization recommendation for my LCP image:
*fetchpriority=high should be applied*
This directly contradicts what is stated in the Nextjs docs. Now i know that lighthouse can be off sometimes and is mainly to give a general indication of performance, but still i would love someone elses input.
I would add fetch priority and preload to the hero image. The docs tell a bit different. I would trust google in in that part
Brown-headed Cowbird
I can doit