HTML formats takes up more space

If you are viewing the http://www.google.com source code, it is highly appreciated. Even the html part. I'm just wondering if formatted html will take up more space than minimized HTML.

All I can imagine is that in a formatted html, characters: spaces, tabs and a new line take up space. And this is the only area in which html minification can save memory.

+4
source share
3 answers

Yes, your thinking is correct. Removing spaces and compressing HTML will result in smaller download sizes.

If you want to see test cases for HTML miniaturization, check out this Perfection Kills blog post .

Excerpts:

Original Size: 217KB (35.8KB gzipped)
Minimum size: 206.6KB (34.3KB gzipped)
Save: 10.4 KB (1.5 KB gzipped)

The amazon.com mini page page saves about 10 KB with an uncompressed document and only 1.5 KB with a compressed one.

+4
source

Yes, minimizing HTML, CSS and JavaScript, removing spaces, tabs, newlines and comments, saves bandwidth costs.

In addition, to minimize HTML, you must also be sure that your HTML, CSS and JavaScript are GZIP'ed when they are sent over the cable for better performance. For more information about GZIP, read: http://developer.yahoo.com/performance/rules.html#gzip

I would also like to add that it is very important to think about the cost of bandwidth and page speed to any extent on this day by age. Mobile website users are booming up. Even if you do not expect a big mobile draw from your site, you are making choices to those who are trying to access your site on their 3G mobile devices without taking proper considerations of cost and bandwidth.

+1
source

Yes, that’s the difference. But for many (most?) Sites, this difference is not worth considering, because (1) the server will probably serve HTML-gzipped in any case, and (2) you do not have enough page views to make the difference significant. (Google does.)

+1
source

Source: https://habr.com/ru/post/1496607/


All Articles