4 ms·
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 combi
by bdfh42 14y ago
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
- mistercow 14y agoThat's all fine and dandy, but minify + gzip is usually significantly better than gzip alone (for javascript and css, at least).
- cheald 14y agoQuantify "significantly". There's a gain, but whitespace compresses Really Damn Well.
- mistercow 14y agoMinifiers 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).
- mistercow 14y agoGZIP + minify is better than GZIP alone.
- fidanov 14y agoIf 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.