Skip to content

Conversation

kevinmeijer97
Copy link
Member

Switched the <source> sizes from 32px to 100vw and set the <img src> back to a tiny data-URI placeholder.
This prevents the browser from eagerly fetching the full image and lets it pick the right size up front, after the load the ResizeObserver refines the rest of the sizes.

<source
srcset="{{ $presets['webp'] }}"
sizes="32px"
sizes="100vw"
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't the default of 100vw force the browser to download a large size?
if an image spans 30% of the screen width, 100vw would download a src as if it were to span 100% of the screen right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants