Forums / Developer / How to minify html / Comment65771
Marko Žmak
Wednesday 09 February 2011 2:06:53 pm
I accidentally just found an interesting tool, mod_pagespeed:
it has a filter that cleans up whitespaces:
It preserves whitespaces in <script> and <pre>, and since it's an apache module I think it should work faster than a PHP output filter. And it also has some other interesting filters.
I'll probably give it a try...
For an interesting detail, note the chapter "Risks" on the whitespace filter page. I don't believe that any HTML minifier will honnor the "white-space: pre" CSS directive.
-- Nothing is impossible. Not if you can imagine it! Hubert Farnsworth