Minify HTML
This rule is currently still experimental, as there are a number of difficulties with minifying HTML:
- Comments can generally be removed from HTML, but some tools may rely on certain special comments being present in the HTML. Page Speed's HTML compactor recognizes and preserves certain classes of important comments, but may unwittingly remove others that should not be removed. If you encounter such a case, please file a bug.
- Whitespace between tags can generally be collapsed, except within whitespace-significant blocks. Page Speed's HTML compactor will avoid collapsing whitespace within, for example, <pre> tags, but currently it may still incorrectly remove whitespace from other blocks that use CSS rules to make whitespace significant.
- Many HTML pages are generated dynamically, in which case the minified HTML file produced by Page Speed cannot simply be used as a drop-in replacement. However, you may, for example, want to use fragments of the minified HTML within a template used to generate the page.
Other HTML tags are optional such as </li> </p> </body> </head>. Plus, it would be great to have more information about how browser handle those "optional" tags, and what are the minify rules.
Tell us minify rules, please!!! Cus we need to minify HTML by server on the fly!
I'm appalled that a Google-sponsored product suggests sloppy html syntax, ditching closing tags... If anything, minify should remove all newlines. In fact, my minified version starts with a blank line: way to give away a byte for no reason!
I am curious if this rule should still be applied in page speed if compression is enabled. The majority of savings comes from removing unnecessary whitespace, which compression already does very well (and on-the-fly).
Please consider updating the page speed rules to take this into consideration (such as assigning a higher minification score if server compression is done).
the minifier removing <!DOCTYPE HTML> makes the page failed validation @ W3c and @ http://html5.validator.nu
One might save speed from downloading fewer bytes, but all user agents will use additional resources when parsing a html file which does not follow the specified standard. The user agents will use CPU power and memory to "guess" and try and correct the document. How much resource overhead is added to the processing of invalid html varies between the different user agents. This makes it difficult to compare the benefit of removing those few bytes. In addition the different user agents has different error handling resulting in an unpredictable appearance and behavior.
For now everyone should avoid using the optimized HTML generated from Google Page-speed and use valid html.
like http://rbctwitter.com use
There is a bug in the Google page-speed minification algorithm. Inline CSS is expanded. See this webpage for example and have a look at the page-speed output http://bobdo.com
This page is minified to the maximum that is possible and is perfectly valid. As all of you can see, it is possible to minify the HTML of a page. But you have to use HTML5 to get best minification. Because other doctypes have a lot of overhead per specification.
mm-test
Any doctype of HTML can be minified accurately without harm to regression. Visit http://prettydiff.com/ to see how any flavor of markup can be minified and then beautified back countless times without loss of fidelity.
me testing for my website http://www.airtickettown.com
Minify by NEVER outputting \n in your code. It's that simple. And remove any useless spaces.
Stay well-formed too. Remember that HTML5 does NOT require /> on tags like <meta> (but XHTML does). For non-XHTML, you can just use >. Clean up empty tags that have no purpose.
To me this is definitely NOT about outputting as little as possible and just ensuring the browser works that way.
How can I improve my site http://www.vividostudio.com ?
One question...
Why should you minfy your HTML if you can use gzip compression on the server? Compressing the page using gzip is not a demanding process regarding all other thing that are happening on the server.
Has anyone made any tests how much do you gain/loose in performance (both in file size and server processing) when you use html minification rather than gzip compression?
Hope someone can help me with my site: http://killerdomains.com.au/ I have compressed js files, css files etc. However, I think I'll wait till I minify html, as the home page is php file.
My question is also, how to use cache correctly. What about those using Joomla based sights that are able to configure the cache in the backend to store files on the server instead? Google page speed doesn't seem to pick that up???
I really like Google's Page Speed Online, but it doesn't appear to offer HTML compression. Aside from using the HTML compression tool that comes in Page Speed browser add ons, is there anywhere online that allows us to use Google's HTML compression tool?
<html> <head> <title> </title> </head>
<body>
<ul type=square> <li> item </li> <li> item </li> <li> item </li> <li> item </li> </ul>
<ol start=40> <li> item</li> <li> item</li> <li> item</li> <li> item</li> </ol>
<ol type=A start=13> <li> item</li> <li> item</li> <li> item</li> <li> item</li> </ol>
<ol type=I> <li> item</li> <li> item</li> <li> item</li> <li> item</li> </ol>
<ol type=I start=100> <li> item</li> <li> item</li> <li> item</li> <li> item</li> </ol>
</body>
</html>
I stil search the rule to speed up my site http://www.hotelmurahdibandungs.com
Does it make sense to work on this issue with following Stats?
"You could save 728B (8%)" http://www.repertorium-online.de
i will reduce js, css and hnlt http://kerjawa.blogspot.com/
http://www.mobilbekas.co.id has many css and javascript in order to increase the display performance and experiance.