ampproject / amp-toolbox

A collection of AMP tools making it easier to publish and host AMP pages.
Apache License 2.0
449 stars 243 forks source link

Don't preload hero images #1132

Closed sebastianbenz closed 3 years ago

sebastianbenz commented 3 years ago

We can't tell whether a hero image is responsive and is loaded depending on viewport size. The current implementation will always preload hero images, which means images might be preloaded even if they are not visible on the page. This PR reverts this behavior and disables preload generation for hero images.

The only exception is when an image defines a media attribute.