News for hackers. Stuff that matters.
Re:How a new HTML element will make the Web faster by NicoJuicy on Tuesday September 02, 2014 @02:47AM (#8256110)
To resize images, i create a cookie with javascript that gives the browsers current width and height. (mostly for full image front pages -> the function for choosing the image width is based on bootstrap)

When i read the title, i thought media-queries would get the functionality to load external stylesheets, which seems like a better option to me (especially if css could fill the img src, then stylesheets reduce in size, but also images. Only this option uses to much back-and-fort communication. Perhaps a default naming would be appropriate (eg. img-1024.jpg => for browsers with a max-width of 1024 px, same could be used with stylesheets). Even a syntax like <img src="small.jpg" srcset="large.jpg 1024w, medium.jpg 640w"> could be used.

PS. If you downvote me, at least do it with the decency of giving arguments...

Re:How a new HTML element will make the Web faster by acdha on Tuesday September 02, 2014 @09:47AM (#8257487)
0. This requires a full server round trip before it can send the right size images.

1. This breaks caching, which is a big deal for most sites.

2. This also has the problem of needing a separate fallback to handle window resizing.

3. This requires a separate approach to handle format detection, although you could set a cookie for that as well.

Re:How a new HTML element will make the Web faster by idlewords on Tuesday September 02, 2014 @02:51AM (#8256119)
It's also horrible for anyone trying to archive your page.
Re:How a new HTML element will make the Web faster by NicoJuicy on Tuesday September 02, 2014 @02:59AM (#8256133)
Then the archiving functionality saves all additional stylesheets and images, so it can be appropriately used later on. But not much people "save" a page as html, they bookmark/favorite it, if it's interesting or print it to pdf (or your favorite document type)- eg. on a checkout

Then again, what's your preference?