How can I optimize this part of the banner when it is mobile, however on desktop this does not happen even with a slightly heavier and larger image, I do not understand why it throws high LCP even though I use an image, I put preload in the index and I have the Angular's ngImage directives and the image is adapted to mobile size with an acceptable weight of approximately 50kb or less.
The domain is https://kids-gamarra.lat/
Using Angular 17.3.1 with SSR
https://pagespeed.web.dev/analysis/https-kids-gamarra-lat/w3o25ra4hm?form_factor=mobile
#Largest Contentful Paint element Angular 17 - SSR Mobile
36 messages · Page 1 of 1 (latest)
did you set width and height on tag img to prevent image shift ?
other thing is you cant use src attr with ngsrc attr
check out the reason
i used a fill true , i understand when use fill true no need use hight and widh or i am wrong?
Code in HTML
I use fill with instructitions of angular documentation
https://angular.io/guide/image-directive#does-ngoptimizedimage-support-the-background-image-css-property
Correct
then why pagespeed throw a LCP hight ? xd
fetchpriority attr looks incorrect and if you are using priority attr you dont need to added fetchpriority as well is redudant
but , make sure where this resources are hosted cause its may increase the lcp as well
assets in the same server in assets folders of Angular , is stranger because with other image more resolution a size in desktop not show error
the others images are treated lazy
The same page but in desktop see the image with more resolution and size not show lcp error
https://pagespeed.web.dev/analysis/https-kids-gamarra-lat/w3o25ra4hm?form_factor=desktop
did you already fix the fetchpriority value as i sad before ?
dont exist height as value ...
no always had a fetchPriority exist , yes not exist height or width because i use a fill true
i use fill because i need similiar behavior of css background in my banner
nope ...
look fetchpriority attr
ahh i see
This value dont exist as well
You can delete this line since you are using priority attr…