I don't have a suggestion, but I wanted to congratulate you on a wonderful idea, really nicely executed.
Thanks Maciej, your obesity article was a one of the sources of inspiration :)
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.
> 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.
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.
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?
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.
How do you measure "TotalPageSize"? Does it take into consideration any plain-text content that's served with "Content-Encoding:gzip"?
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."
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.