Skip to content

Do not preload hero images using srcset#828

Merged
sebastianbenz merged 2 commits intomasterfrom
hero-srcset
Jun 8, 2020
Merged

Do not preload hero images using srcset#828
sebastianbenz merged 2 commits intomasterfrom
hero-srcset

Conversation

@sebastianbenz
Copy link
Copy Markdown
Collaborator

Fixes #823

@@ -69,17 +69,9 @@ class PreloadHeroImage {
preload.attribs.media = heroImage.media;
}
if (heroImage.srcset) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be configurable? Should there be a flag to force inclusion of images that have srcset?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would cause double image downloads which is something I'd prefer to avoid.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But only on non-Chromium browsers. It's not needed now, but it would be useful in the near future to evaluate the performance impact for pages that use srcset.

Co-authored-by: Weston Ruter <westonruter@google.com>
@sebastianbenz sebastianbenz merged commit 9de6286 into master Jun 8, 2020
@sebastianbenz
Copy link
Copy Markdown
Collaborator Author

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PreloadHeroImage should use imagesrcset attribute not srcset

3 participants