News for hackers. Stuff that matters.
Re:Web Bloat Score Calculator by ZeljkoS on Tuesday October 25, 2016 @07:38AM (#12787012)
Hi, author here.

I wanted to measure visual information content of a page, and yes, PNG is maybe not the best to do that. JPEGs are smaller, but it introduces another problem of visible artifacts around text.

If anybody knows a better way to measure visual information content, please suggest.

Re:Web Bloat Score Calculator by idlewords on Tuesday October 25, 2016 @08:03AM (#12787148)
I don't have a suggestion, but I wanted to congratulate you on a wonderful idea, really nicely executed.
Re:Web Bloat Score Calculator by ZeljkoS on Wednesday October 26, 2016 @06:38AM (#12795372)
Thanks Maciej, your obesity article was a one of the sources of inspiration :)
Re:Web Bloat Score Calculator by hyperpape on Tuesday October 25, 2016 @09:41AM (#12787847)
I don't have a worked out idea, but maybe if a site has more than a certain amount of images, start to multiply their contribution to the size of the page? So if you double the image content, then a page that literally takes 10 MB to load, of which 9.5 MB are images has the calculation:

19.5 / 10 = 1.95. (assuming the PNG is 10 MB for simplicity).

You could be fancy and use exponent.

But I doubt there's a good mechanical way to do this. Whether an image is bloat or valuable content requires sophisticated judgment and understanding of what the purpose of the page is.

Re:Web Bloat Score Calculator by ZeljkoS on Wednesday October 26, 2016 @07:00AM (#12795483)
> Whether an image is bloat or valuable content requires sophisticated judgment and understanding of what the purpose of the page is.

I completely agree with that. Quick check is to replace all images on a page with placeholder images—if that doesn't reduce functionality of the page then maybe you don't need that images at all.

Re:Web Bloat Score Calculator by Filligree on Tuesday October 25, 2016 @10:50AM (#12788453)
Well, you wouldn't be showing the JPEGs to anyone. Using JPEG compression for the calculation might be perfectly fine.

By the way, your calculator seems to include prefetched pages in the calculation. (link rel="prefetch".) Not sure if that's deliberate or not.

Re:Web Bloat Score Calculator by ZeljkoS on Wednesday October 26, 2016 @06:51AM (#12795439)
Yes, prefetch is deliberate as that is the default behavior of SlimmerJS and most of the browsers.
Re:Web Bloat Score Calculator by michaelmior on Tuesday October 25, 2016 @09:54AM (#12787964)
Why are visible artifacts around text a problem? The screenshots are just being used to calculate the metric. Is it really important what they look like?
Re:Web Bloat Score Calculator by ZeljkoS on Wednesday October 26, 2016 @06:48AM (#12795421)
There is some truth to that, but I wanted screenshots to be visible for comparison and to have the same visual functionality. Artifacts around text make it hard to read, thus less functional.
Re:Web Bloat Score Calculator by gsylvie on Tuesday October 25, 2016 @04:39PM (#12791467)
How do you measure "TotalPageSize"? Does it take into consideration any plain-text content that's served with "Content-Encoding:gzip"?
Re:Web Bloat Score Calculator by ZeljkoS on Wednesday October 26, 2016 @08:07AM (#12795751)
From my developer: "We measure every request that was received by SlimerJS, also for any request that sends a resource as GZIP, but does not specify its size, we will GZIP that content ourselves in order to get its size."