Skip to content

Lighthouse audit warns to defer offscreen images on AMP pages #25682

@westonruter

Description

@westonruter

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:

In the first case:

image

And in the second case:

image

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions