News for hackers. Stuff that matters.
Re:How a new HTML element will make the Web faster by dkyc on Tuesday September 02, 2014 @04:17AM (#8256322)
The article mentioned the problem with this approach: Your browser loads the HTML, CSS, JS simultaneously with the images on the start of the page load - so when you find out what size you need at runtime (via JS), and then put in the right img-src, it will be slower than loading a higher-res version right from the start.

Another option would be to "guess" the right size to serve based on the User Agent String (maybe you meant this and I misunderstood?). This could work, although the server may very well guess wrong.

Re:How a new HTML element will make the Web faster by bambax on Tuesday September 02, 2014 @04:45AM (#8256404)
Yes, I meant "guessing" the right size based on the user-agent string as the best approach (since it doesn't rely on the browser doing the work, it will work with any browser, including old ones).

But I also maintain that a single image of relatively small size can be used for all form factors if its quality is good enough (resized by the browser based on CSS instructions); you can at least double the size of a "good" image before you begin to see problems.

Re:How a new HTML element will make the Web faster by eldelshell on Tuesday September 02, 2014 @05:59AM (#8256687)
The user-agent is the biggest cluster fuck in the history of the web and has nothing to do with HTML. Once you understand this, you'll learn to ignore it.