CS Fundamentals Trainer · JavaScript · Performance & Memory
The LCP element on a landing page is a large hero image. Which changes are likely to improve LCP?
- Adding `fetchpriority="high"` to the hero `<img>` or preloading it
- Adding `loading="lazy"` to the hero image
- Reducing server response time (TTFB) with caching or a CDN
- Adding `width` and `height` attributes to the hero image
- Serving the image in a smaller, compressed format such as AVIF or WebP
Difficulty: medium