[ANN] mod_strip

Evan Miller emmiller at gmail.com
Mon Jan 28 21:55:46 MSK 2008


Ever get annoyed at all those extra spaces in your web site's HTML? Do 
you fantasize about one day reaping all those tabs and newlines that do 
nothing but cost you bandwidth?

Fantasize no longer! I've written a quick hack for Nginx that strips out 
superfluous whitespace from HTML documents, both static and proxied. 
It's fast. It's memory-efficient. It's available here:

http://wiki.codemongers.com/NginxHttpStripModule

Think of it as a poor man's Gzip (though it can be used in conjunction 
with Gzip).

Disclaimer: while mod_strip works for me, the module could horribly 
mangle mal-formed HTML. This will be corrected in a future version... 
but I thought I'd go ahead and throw this code out there for the 
adventurous types.

Cheers,

Evan






More information about the nginx mailing list