You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jens Lorenz <je...@interface-projects.de> on 2002/07/01 10:34:40 UTC

Re: serializer sending gzip compressed html

----- Original Message -----
From: "Luca Morandini" <lu...@tin.it>
To: <co...@xml.apache.org>
Sent: Saturday, June 29, 2002 4:51 PM
Subject: RE: serializer sending gzip compressed html


> Jens,
>
> maybe it is just me, but... what about web-server compression ?

No it's not just you. Stefano had another idea for the same purpose.

> I suppose the web-server intercepts and compresses the output coming out
of any servlet (as long as the servlet has not been called
> directly (i.e. ":8080"))... am I wrong ?
>
> Best regards,
>

You're right. I thought of using mod_gzip too. But then you'll
only do this for production systems. At least I've been using
Tomcat always standalone for development.

Also AFAIK mod_gzip does not cache the results and needs an
external working directory. (while most certainly being faster
than the Java version)


Stefano suggested to use a GZIPServletFilter. To be honest, living
entirely in a Cocoon world I never had a deeper look into Servlet
APi and deployment descriptors. So I never knew that such stuff
is possible with servlets.

So a Servlet-Filter would be the third way to achieve compressed
output from cocoon. But the disadvantage of GZIPServletFilter is
the missing caching as well.


In a production environment with a tomcat/apache combo and a reverse
proxy in front of tomcat, the missing caching does not matter. But
not all projects need such a setup.


Well, IMHO there are still some cases where a GZIPSerializer might
be useful. But thanks to you Luca and Stefano for opening my eyes
for the world outside Cocoon.



Best Regards,


Jens

--

jens.lorenz at interface-projects dot de

interface:projects GmbH                             \\|//
Tolkewitzer Strasse 49                              (o o)
01277 Dresden                               ~~~~oOOo~(_)~oOOo~~~~
Germany


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Summary: serializer sending gzip compressed html

Posted by Stefano Mazzocchi <st...@apache.org>.
John Morrison wrote:
> 
> I think this would be interesting :) +0

Yes, definately... even if I still believe it should be the "transparent
proxy in front of your web server"'s job to do this so that you get
maximum benefit.

> > From: Jens Lorenz [mailto:jens.lorenz@interface-projects.de]
> > From: "Stefano Mazzocchi" <st...@apache.org>
> > > > Well, IMHO there are still some cases where a GZIPSerializer might
> > > > be useful. But thanks to you Luca and Stefano for opening my eyes
> > > > for the world outside Cocoon.
> > >
> > > You are welcome.
> > >
> > > Anyway, I believe that a HTML-gzipping-serializer is a bad idea because
> > > is mixes concerns: GZIP compression is a property of the transport layer
> > > and should be transparent.
> > >
> > > As for lack of caching: I also think that Cocoon should stop caching its
> > > generated resources and just try to be more proxy friendly. But that is
> > > another story.
> >
> > To summarize this issue ... I tested the CompressionFilter coming as
> > example with Tomcat and it works just fine. No need to hack into Cocoon
> > and doesn't serve incomplete gzip files.
> > Also it automatically detects accept-encoding of the browser and only
> > compresses, if compression is supported by the http client.
> >
> > For production environments, it's probably a good idea to extend this
> > example to compress only html and text files. No much sense in compressing
> > gif and jpg files, besides wasting cpu cycles ...
> >
> > If anyone is interested, I would prepare a patch to the CompressionFilter
> > coming with tomcat and to cocoons web.xml, with the filter commented out,
> > so that only these comments need to be removed, in order to get compressed
> > output from cocoon/tomcat.
> >
> >
> > Jens
> >
> > --
> >
> > jens.lorenz at interface-projects dot de
> >
> > interface:projects GmbH                             \\|//
> > Tolkewitzer Strasse 49                              (o o)
> > 01277 Dresden                               ~~~~oOOo~(_)~oOOo~~~~
> > Germany
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org


-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: Summary: serializer sending gzip compressed html

Posted by John Morrison <jo...@ntlworld.com>.
I think this would be interesting :) +0

> From: Jens Lorenz [mailto:jens.lorenz@interface-projects.de]
> From: "Stefano Mazzocchi" <st...@apache.org>
> > > Well, IMHO there are still some cases where a GZIPSerializer might
> > > be useful. But thanks to you Luca and Stefano for opening my eyes
> > > for the world outside Cocoon.
> >
> > You are welcome.
> >
> > Anyway, I believe that a HTML-gzipping-serializer is a bad idea because
> > is mixes concerns: GZIP compression is a property of the transport layer
> > and should be transparent.
> >
> > As for lack of caching: I also think that Cocoon should stop caching its
> > generated resources and just try to be more proxy friendly. But that is
> > another story.
>
> To summarize this issue ... I tested the CompressionFilter coming as
> example with Tomcat and it works just fine. No need to hack into Cocoon
> and doesn't serve incomplete gzip files.
> Also it automatically detects accept-encoding of the browser and only
> compresses, if compression is supported by the http client.
>
> For production environments, it's probably a good idea to extend this
> example to compress only html and text files. No much sense in compressing
> gif and jpg files, besides wasting cpu cycles ...
>
> If anyone is interested, I would prepare a patch to the CompressionFilter
> coming with tomcat and to cocoons web.xml, with the filter commented out,
> so that only these comments need to be removed, in order to get compressed
> output from cocoon/tomcat.
>
>
> Jens
>
> --
>
> jens.lorenz at interface-projects dot de
>
> interface:projects GmbH                             \\|//
> Tolkewitzer Strasse 49                              (o o)
> 01277 Dresden                               ~~~~oOOo~(_)~oOOo~~~~
> Germany
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Summary: serializer sending gzip compressed html

Posted by Jens Lorenz <je...@interface-projects.de>.
----- Original Message -----
From: "Stefano Mazzocchi" <st...@apache.org>
To: <co...@xml.apache.org>
Sent: Monday, July 01, 2002 5:41 PM
Subject: Re: serializer sending gzip compressed html


> > Well, IMHO there are still some cases where a GZIPSerializer might
> > be useful. But thanks to you Luca and Stefano for opening my eyes
> > for the world outside Cocoon.
>
> You are welcome.
>
> Anyway, I believe that a HTML-gzipping-serializer is a bad idea because
> is mixes concerns: GZIP compression is a property of the transport layer
> and should be transparent.
>
> As for lack of caching: I also think that Cocoon should stop caching its
> generated resources and just try to be more proxy friendly. But that is
> another story.

To summarize this issue ... I tested the CompressionFilter coming as
example with Tomcat and it works just fine. No need to hack into Cocoon
and doesn't serve incomplete gzip files.
Also it automatically detects accept-encoding of the browser and only
compresses, if compression is supported by the http client.

For production environments, it's probably a good idea to extend this
example to compress only html and text files. No much sense in compressing
gif and jpg files, besides wasting cpu cycles ...

If anyone is interested, I would prepare a patch to the CompressionFilter
coming with tomcat and to cocoons web.xml, with the filter commented out,
so that only these comments need to be removed, in order to get compressed
output from cocoon/tomcat.


Jens

--

jens.lorenz at interface-projects dot de

interface:projects GmbH                             \\|//
Tolkewitzer Strasse 49                              (o o)
01277 Dresden                               ~~~~oOOo~(_)~oOOo~~~~
Germany


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: serializer sending gzip compressed html

Posted by Stefano Mazzocchi <st...@apache.org>.
Jens Lorenz wrote:

> Well, IMHO there are still some cases where a GZIPSerializer might
> be useful. But thanks to you Luca and Stefano for opening my eyes
> for the world outside Cocoon.

You are welcome.

Anyway, I believe that a HTML-gzipping-serializer is a bad idea because
is mixes concerns: GZIP compression is a property of the transport layer
and should be transparent.

As for lack of caching: I also think that Cocoon should stop caching its
generated resources and just try to be more proxy friendly. But that is
another story.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org