Re: [RFC/PATCH] gitweb: Enable transparent compression form HTTP output
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Aug 25, 2007, 22:09 UTC
- Message-ID
- <200708260009.30092.jnareb@gmail.com>
- In-Reply-To
- <20070825180350.GA1219@pasky.or.cz>
On Sat, Aug 25, 2007, Petr Baudis wrote:
> On Wed, Jul 25, 2007 at 08:39:43PM CEST, Jakub Narebski wrote:
Show 5 quoted lines
>> Check if PerlIO::gzip is available, and if it is make it possible to > > It doesn't really check if the require succeeded. Either the description > or (preferrably, but not a showstopper, IMO) the code should be > adjusted.
It does not check if require succeeded (I could do that this way), but instead checks if $PerlIO::gzip::VERSION is defined (if it is true).
our $enable_transparent_compression = !! $PerlIO::gzip::VERSION;
Show 7 quoted lines
>> enable (via 'compression' %feature) transparent compression of HTML >> output. Error messages and any non-HTML output are excluded from >> transparent compression. >> >> Signed-off-by: Jakub Narebski <jnareb@gmail.com> > > Acked-by: Petr Baudis <pasky@suse.cz>
By the way, this was more "proof of concept" than solution of an itch.
Show 6 quoted lines
> I'd put it on repo.or.cz... too bad that there I value CPU much more > than the bandwidth. ;-) > > Why did you exclude non-HTML output from transparent compression? Me and > I guess other people too sometimes download rather large chunks of raw > data over gitweb.
Because it was easiest. We have single point of entry for HTML output (the git_header_html subroutine), but we don't have anything similar for non-HTML output. And we most certainly wouldn't want to enable transparent compression for snapshots and 'blob_plain' view for compressed files, including png, gif, jpeg, zip, mp3, ogg,...
-- Jakub Narebski Poland