GZip compression in Perlbal

Brad Fitzpatrick brad at danga.com
Sun Mar 9 03:48:51 UTC 2008


Igor,

We need to do a release for Fedora Core and their Perl 5.10 dependency, so
I've reverted the gzip patches until we can finish this discussion.

I do want to see it go in, but it'll need some cleanup first in addition to
design/code review.  (for instance, while reverting it, I noticed a mismatch
of spaces and tabs... see http://danga.com/commit.bml)

- Brad

On Thu, Mar 6, 2008 at 6:20 AM, Igor Gariev <igor.gariev at sup.com> wrote:

>  Guys,
>
> the compression feature is for _*concatenated*_ files only.
>
>
>
> Surely, no one would compress file at every request if it can be done
> beforehand.
>
> The concatenated output is in a way a dynamic content, since names of
> files to be concatenated are known at run-time only.
>
> The caching of the output is problematic too, since if the number of files
> is N then there are 2^N possible combinations that may be requested.
>
>
>
> To create a compressed stream from pre-compressed files is not possible
> too, since though gzip algorithm allows for several frames in stream, some
> popular browsers (IE 6.0, FF 2.0) don't understand such streams and
> display the first compressed frame only.
>
> The more info can be found here: http://torrez.us/archives/2007/09/24/550/(thanks to Brad Whitaker for the link).
>
>
>
> Regards,
>
> Igor Gariev.
>
>
>
> PS. Thanks for Apache config for static files, it's amazingly simple and
> effective.
>
>
>  ------------------------------
>
> *From:* perlbal-bounces at lists.danga.com [mailto:
> perlbal-bounces at lists.danga.com] *On Behalf Of *Brad Fitzpatrick
> *Sent:* Thursday, March 06, 2008 4:56 AM
> *To:* perlbal at lists.danga.com
> *Subject:* Re: GZip compression in Perlbal
>
>
>
> Exactly!  That's the approach I always planned to take with adding gzip
> support to Perlbal... parallel pre-compressed files.  Then just check the
> modtimes must be newer.
>
> I'm against the idea of doing it at serve-time.  If it _must_ be done at
> serve time, I'd like to see a Perlbal-owned directory (separately
> configured) that holds the on-the-fly compressed files for future Perlbal
> requests to re-use.
>
> I don't like all the extra code and complexity that this on-the-fly
> version adds.  Seems like a maintenance problem for a solution that's not
> even ideal anyway.
>
> The concatenated resource support in Perlbal lays the groundwork for doing
> multiple parallel stats at request time, so reusing that to parallel stat
> the normal and .gz version would be a good start and should add very little
> new code.
>
> - Brad
>
> On Wed, Mar 5, 2008 at 5:16 PM, Brad Fitzpatrick <brad at danga.com> wrote:
>
> Exactly!  That's the approach I always planned to take with adding gzip
> support to Perlbal... parallel pre-compressed files.  Then just check the
> modtimes must be newer.
>
> I'm against the idea of doing it at serve-time.  If it _must_ be done at
> serve time, I'd like to see a Perlbal-owned directory (separately
> configured) that holds the on-the-fly compressed files for future Perlbal
> requests to re-use.
>
> I don't like all the extra code and complexity that this on-the-fly
> version adds.  Seems like a maintenance problem for a solution that's not
> even ideal anyway.
>
> The concatenated resource support in Perlbal lays the groundwork for doing
> multiple parallel stats at request time, so reusing that to parallel stat
> the normal and .gz version would be a good start and should add very little
> new code.
>
>
>
>  On Wed, Mar 5, 2008 at 1:20 PM, Ask Bjørn Hansen <ask at develooper.com>
> wrote:
>
>
> On Mar 5, 2008, at 11:18, Mark Smith wrote:
>
> > The idea is then that these small files are just stored in memory and
>
> > we don't have to re-gzip them every time [...]
>
> What I do (with Apache) is pre-compress the files and have Apache just
> send the ".gzip" file when it's there.
>
>   AddEncoding gzip .gzip
>
>   RewriteCond %{HTTP:Accept-Encoding} gzip
>   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}.gzip -f
>   RewriteRule ^(.*)$ $1.gzip [L]
>
> Compressing static files at request time seems slightly insane ...
>
>
>  - ask
>
> --
> http://www.askbjoernhansen.com/
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/perlbal/attachments/20080308/9a178ec2/attachment.htm 


More information about the perlbal mailing list