While at imgix, I spent a lot of time thinking about responsive images. It’s a very interesting problem that pays big dividends when solved correctly. By serving up the correctly sized images, you’re able to send less data across the wire to the client, resulting in a faster experience.
This approach uses generated srcset values to give a bucket of potential images to the browser, and then lets the browser choose which one to serve. (For a primer on srcset and sizes, read the definitive post by Eric Portis.)
Even this right-in-most-cases-approach is difficult to implement correctly. I believe the agreed upon nomenclature is “terrible”: