News for hackers. Stuff that matters.
Re:Web Bloat Score Calculator by lazyjones on Tuesday October 25, 2016 @04:39AM (#12786239)
I found an interesting case where WebBS does not seem to reflect my understanding of "bloat". A very long page with

Page size: 3,672 kB and 219 requests

Image size: 11,390 kB (http://www.webbloatscore.com/Screenshots/58b58030-6807-4638-...)

WebBS score: 0.322

It's apparently easy to obtain a good WebBS score by including lots of JPEG images. The PNG used for the image size calculation is typically much larger for the same bitmap, so every JPEG reduces the WebBS score.

Re:Web Bloat Score Calculator by IsmaOlvey on Tuesday October 25, 2016 @06:22AM (#12786666)
More generally, visual simplicity will be penalized. As an example, http://jsbin.com/milelocito gets a score of 0.011, and http://jsbin.com/fejevatihi a score of 0.035.

The site timed out while trying to calculate the scores, so I had to do it manually. The respective sizes were 3377 (html), 283130 (png) and 3323 (html), 92815 (png).

This example is a bit contrived, but you'll see the same effect for more subtle decorations as well (e.g. box-shadow, ...).

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."
Re:Web Bloat Score Calculator by svens_ on Tuesday October 25, 2016 @06:06AM (#12786613)
I was finally able to try it out and this is exactly my observation too.

I've got a very similar score of 0.323 for an Angular SPA with a bunch of dependencies (1,276 kB, 44 requests) that basically shows 5 jpeg images.

Would be interesting to see the result when using JPEG instead of PNG. However it's still easy to gamble, just display some large JPEG images in full size and the score will approach 1.

Edit: By the way, here's a working screenshot link for the score above (image size 3,947 kB): http://www.webbloatscore.com/Screenshots/aeea9b6a-4852-4b01-... They screenshot the whole page.

Re:Web Bloat Score Calculator by lazyjones on Tuesday October 25, 2016 @06:15AM (#12786646)
> just display some large JPEG images in full size and the score will approach 1.

Or less, depending on the JPEG quality setting used in each case I guess. That's not completely unreasonable though - if I only want to look at a few large images (e.g. from Mars) and my browser downloads mostly just that, it's not really bloated.