PageSpeed : Minify HTML

Published

Compacting HTML code, including any inline JavaScript and CSS contained in it, can save many bytes of data and speed up downloading, parsing and execution time.



Why minify HTML?


Minifying HTML has same benefits as minimizing  CSS and Minimizing JavaScript. As it will help to download, parse, and execute faster than the normal uncompressed state.

Simple Test + Result .


This is non-minified HTML.


<html>
<head>
    <title>
Page Title
    </title>
</head>
<body>
this<br/>
is   <br/>
the <br/>
content.
</body>
</html>

Size : 132 bytes



This is minified HTML.



<html><head><title>Page Title</title></head><body>this<br/>is   <br/>the <br/>content.</body></html>

Size : 99 bytes.

Reduction : 33 bytes.



As you could see in above test results, HTML Compression can reduce the size of the webpage an it will load faster than before.

Solutions and tools to Minify HTML

Do it in PHP



An Online  HTML Compressor.
http://www.willpeavy.com/minifier/




Comments

Post a Comment