Connect (which Express is built on top of) used to include a gzip middleware, but it's gone in Connect 1.0 / Express 2.0. You could look at the old implementation in Connect, but IIRC the reason they were dropped was because they were too inefficient to be of benefit.
--
Laurie Harper
http://laurie.holoweb.net/