In PHP, you may write: ob_start("ob_gzhandler") and get all the output GZip-ed automatically. CGI::WebGzip does the same thing. Is you include this module in the beginning of your program, it whill capture all the output. When the script ends, CGI::WebGzip compresses captured data and send it to browser.
use CGI::WebGzip するだけで標準出力を圧縮するモジュール。ブラウザが gzip に対応していない場合はそのまま返すそう。スクリプトの先頭を書き換えるだけで対応できるというのは楽でいいです。
リバース proxy で mod_deflate を有効にするのが一番いいとは思いますが、そこまで用意する規模じゃないとか、環境構築が難しい場合にさくっと使うとベンリかも。