News for hackers. Stuff that matters.
Re:Ask HN: Why do we minify JavaScript, yet not HTML? by bdfh42 on Sunday December 02, 2012 @04:54PM (#4862677)
GZIP will compress your html for the journey from server to browser if a) it is enabled on the server and b) the browser can handle it.

Almost any modern combination should work fine.

OK - there is a cpu overhead for the server but if bandwidth is the issue then it sure beats any attempt at minifying the HTML

Re:Ask HN: Why do we minify JavaScript, yet not HTML? by mistercow on Sunday December 02, 2012 @05:29PM (#4862827)
That's all fine and dandy, but minify + gzip is usually significantly better than gzip alone (for javascript and css, at least).
Re:Ask HN: Why do we minify JavaScript, yet not HTML? by cheald on Sunday December 02, 2012 @06:40PM (#4863120)
Quantify "significantly". There's a gain, but whitespace compresses Really Damn Well.
Re:Ask HN: Why do we minify JavaScript, yet not HTML? by mistercow on Monday December 03, 2012 @12:11AM (#4864064)
Minifiers don't just remove whitespace. Eliminating comments, for example, can save a lot (although it seems that most HTML out there is poorly commented in the first place). A smart minifier can also drop optional closing tags like </li> for a bit more gain (although I don't know of a minifier that does).
Re:Ask HN: Why do we minify JavaScript, yet not HTML? by mistercow on Monday December 03, 2012 @12:38AM (#4864115)
GZIP + minify is better than GZIP alone.
Re:Ask HN: Why do we minify JavaScript, yet not HTML? by fidanov on Friday December 07, 2012 @02:58AM (#4885992)
If you have really a lot of whitespace (like one of the js "gurus" from the Chrome team) then minify may help.

Most of the time GZIP + minify is not significantly smaller then GZIP, and thus minifying HTML or JS is not worth it + may prevents good debugging.