Minify HTML

Minifying HTML has the same benefits as those for minifying CSS and JS: reducing network latency, enhancing compression, and faster browser loading and execution. Moreover, HTML frequently contains inline JS code (in

https://developers.google.com/speed/docs/best-practices/payload#MinifyHTML

https://code.google.com/p/page-speed/wiki/MinifyHtml

Compress your HTML code using PHP

function compress_html($a) { $s = array('/>[^S ]+/s','/[^S ]+</s',/(s)+/s); $r = array(>,<,'1'); $a = preg_replace($s, $r, $a); $a = str_replace(array(rn,'n', 'r', 't'), '', $a);
$a = str_replace(' &nbsp;', &nbsp;, $a);
$a = str_replace('&nbsp; ', &nbsp;, $a);
$a = trim($a); return $a;}