Why can serving AVIF to all supporting browsers backfire for Core Web Vitals when the encoding profile is not calibrated for decoding speed alongside file size?
Answered 3-minute answer rooted in 1 page
Because a smaller file only shortens one part of Largest Contentful Paint, and a format switch can leave the total unchanged or move time elsewhere. web.dev’s LCP guide uses this exact case as its example: switching to “a more optimal format (such as AVIF or WebP)” reduces the resource load duration, “but it wouldn’t actually improve LCP” when the time “would just shift to the element render delay subpart”. Decoding is one more cost the file size does not show. Whether AVIF helps a given LCP image is an empirical question to answer with field measurements, not a property of the format.
What a format change can and cannot change
The LCP optimization guide splits LCP into four subparts: time to first byte, resource load delay, resource load duration and element render delay. A smaller image file acts on exactly one of them:
| Subpart | Affected by a smaller image file? |
|---|---|
| Time to first byte | No |
| Resource load delay (when the image starts loading) | No; this depends on how early the image is discovered |
| Resource load duration | Yes |
| Element render delay | No, and it can absorb the time saved if something else holds the paint back |
The guide’s example is a page whose LCP element is hidden until JavaScript finishes loading. A faster image download there just waits longer for the script, and LCP stays the same.
Where AVIF specifically can disappoint
Two situations explain why switching to AVIF may not pay off for LCP:
The download was not the bottleneck. If the image is discovered late, waits for JavaScript, or arrives after a slow first byte, a smaller file changes little. Measure the subparts first: if resource load duration is a small part of LCP, a format change has little to work with.
Decoding is part of the cost. After the file arrives, the browser must decode it before painting, and that processing time is not visible in the file size. How much it costs depends on the format, the encoder settings, the image dimensions and the device. Lower-end phones are part of the mobile 75th percentile, and on them decode time is part of what the visitor waits for. A byte comparison on a desktop does not show it.
The decoding point is a reason to measure, not a rule that AVIF decodes slowly. Results depend on the encoder, its settings, the image and the device.
How to decide per image, not per format
- Find the LCP image and its subparts in field data. Use real-user monitoring that records the LCP element and the four subparts on mobile.
- Fix discovery and priority first. The LCP image should be in the HTML, not loaded late by CSS or script, and it should not be lazy-loaded.
- Test AVIF against the current format on the LCP template. Compare encoder settings, not just formats, and measure LCP on representative low-end devices as well as desktop.
- Roll out where it wins. Serve AVIF for images where field LCP improves and keep the existing format where it does not. A blanket policy for “all supporting browsers” assumes every image and device behaves the same way.
- Confirm in the field. Lab tests on fast hardware understate decode cost; the 75th percentile of real mobile visits is the number that decides.
AVIF can shrink files well. Whether that shrinks LCP depends on which part of LCP the file was holding up.
Answers that share these roots
- Why does switching from client-side rendered hero text to server-rendered HTML sometimes worsen LCP instead of improving it? shares 1 page
- Is it true that TTFB is not a Core Web Vital and therefore has no direct impact on Google page experience ranking signals? shares 1 page
- Why does Largest Contentful Paint sometimes attribute delay to TTFB even when server response times are under 200ms? shares 1 page
- What is the optimal resource-loading strategy to ensure an above-the-fold background image does not become the LCP bottleneck on responsive layouts? shares 1 page
- What end-to-end image optimization pipeline should a media-heavy site implement to guarantee LCP compliance across device tiers without manual intervention per image? shares 1 page
- Is it true that converting all images to WebP is sufficient image optimization for passing Core Web Vitals, making further compression or responsive sizing unnecessary? shares 1 page
Leave a Reply