in reply to STDOUT and mod_perl

RTFM?

mod_perl gzip output:
    CGI::Compress::Gzip
    mod_perl: Web Content Compression FAQ

Replies are listed 'Best First'.
Re^2: STDOUT and mod_perl
by albert (Monk) on Aug 29, 2006 at 13:49 UTC
    This is not exactly what I want, and I've already looked at these things. I am not looking to compress all the output in response to the request from the browser. I am looking to have my CGI give output as either 'gzipped' or as 'text' depending on an option selected by the user. If selected, I want the output to come as an file attachment.

    -a

      Look a little harder, CGI::Compress::Gzip works with mod_perl:
      Note that the Zlib library on which this code is ultimately based requires a fileno for the output filehandle. Where the output filehandle is faked (i.e. in mod_perl), we instead use in-memory compression. This is more wasteful of RAM, but it is the only solution I've found (and it is one shared by the Apache::* compression modules).