I have a question if automated optimizing of HTML has any performance benefit ? I am using deflate on my Apache. My HTML is manually structured so it has a lot of whitespaces, so I thought if it would help to strip these whitespaces so the resulting HTML would be smaller.
Asked
Active
Viewed 659 times
1
-
Does you web server support gzip compression? Are you using it to serve up pages? – Oded Jan 25 '12 at 10:47
-
also see the discussion on this question: http://stackoverflow.com/questions/5362167/remove-whitespace-from-html – robasta Jan 25 '12 at 10:50
-
yes, I also have web gzip compression turned on. – Frodik Jan 25 '12 at 10:50
2 Answers
2
I think that is a CPU/memory vs bandwidth usage tradeoff. You can save some bytes and use more CPU/memory. I think it depends on your application, but in many cases, using gzip to compress HTML contents is a better idea. Most browsers out there already support it.

Guido
- 46,642
- 28
- 120
- 174
1
Absolutely not. gzip
ping in the web server will take advantage of redundancies like spaces. Any processing performed to compress spaces in your html will simply duplicate that processing, and risk messing with any CDATA
you have.

Marcin
- 48,559
- 18
- 128
- 201