-
Notifications
You must be signed in to change notification settings - Fork 4.1k
amp-img ssr: don't generate sizes attribute #32644
Copy link
Copy link
Closed
Description
Problem
Server-side rendering a hero image can cause double download of the same image when using srcset but not sizes. The problem is: the amp-img extension in that case generates a viewport specific sizes attribute which might cause a re-download of the same image.
Steps to reproduce
Load https://lava-useful-horesradish.glitch.me/ in DevTools simulating a mobile device, e.g. G4. You can see that the image is downloaded twice:
Suggested fix
Don't generate a sizes attribute for ssr'd img. There's no value in setting this anyway, as the user agent has already decided at this point in time which image to download.
Reactions are currently unavailable
