-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Lighthouse audit warns to defer offscreen images on AMP pages #25682
Description
What's the issue?
A couple times now I've received reports that the Lighthouse performance audit is identifying “Defer offscreen images” as an opportunity for improvement… on AMP pages. The heuristic being used for lazy-loading images in Lighthouse is not matching up with AMP's lazy-loading implementation. These are AMP pages that are using amp-img.
Examples:
- https://www.ourtasteforlife.com/pink-beach-in-labuan-bajo/amp/
- https://elsoberano.org/ (an AMP-first site)
In the first case:
And in the second case:
In both cases, the images being reported as needing to be deferred are within 3 viewport heights from the top of the page. I recall that amp-img aggressively fetches images when they get within 3 viewports but heavier components like amp-youtube fetch within 1 viewport.
In any case, should the Lighthouse audit should be relaxed? Or should amp-img be more strict?
How do we reproduce the issue?
Run a Lighthouse performance audit on an AMP page that contains an amp-img in the second or third viewport from the top of the page.
What browsers are affected?
Lighthouse

