I have an image that at the moment is only one size (600px x 300px), and I use CSS to make sure it responds to viewport widths. Under 600px it's width is 100%, over 600px it's fixed at 600px.
I now want to use:
<img src="" srcset="" sizes="" />
...to implement responsive images with the hope that mobile users can download smaller file-size images.
Very quickly I've run into the "small screen vs network speed" issue.
I can make multiple image sizes available, but the pixel density on some mobiles means that sometimes a mobile would request a much larger image than a desktop. I have two internet connected devices in front of me:
- Windows desktop, widescreen monitor, very fast network connection, pixel density x1.
- iPhone X, 3G connection,
375pxviewport, pixel density x3.
Using srcset and sizes would mean the desktop downloads a 600px image, and the iPhone downloads a 1125px (375 * 3) image.
Question:
Do browsers take network speed into account (would my iPhone on a slow 3G connection select a smaller image from srcset, or would it always us 1125px)..?
I've searched online for an answer, I can't find anything, I'm happy to be pointed in the right direction from a link.