3 ms·
I doubt you would need so many srcset rules, since there's likely an upper maximum of image size in bytes that you'd like to deliver, and a minimum size you can
by ehnto 4y ago
I doubt you would need so many srcset rules, since there's likely an upper maximum of image size in bytes that you'd like to deliver, and a minimum size you can expect the image to get to. If you're being so pragmatic as to worry about the filesize of your markup, you don't want to then blow up your download budget with massive images.
I think browsers and protocols could do more to help this issue, by sending some context along with the request for the image in the first place, so the server can make some decisions. We can do that ourselves too, but it's not a very robust solution to be using javascript to make decisions for image sizes before you've even finished loading your page.
- rhdunn 4y agoIIUC, the idea is to prevent resizing on common phone sizes so they don't spend additional time and CPU/GPU resources processing the images once they are downloaded.