You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Bart Guijt <b....@chello.nl> on 2003/02/03 13:50:00 UTC

Compressing output from Cocoon

Hi all,

I'm interested to see whether the following technique is useful for Cocoon apps as well: compressing requested content if the client supports it. The article at the following link illustrates this best:


    http://www.servletsuite.com/servlets/compress.htm


I browsed the Cocoon sources to see whether something like this was already implemented, but apparantly it's not.

Has anybody used this before? What are your experiences?


Ciao,

Bart Guijt

Re: Compressing output from Cocoon

Posted by Stefano Mazzocchi <st...@apache.org>.
Bart Guijt wrote:
> From: "Leszek Gawron" <ou...@kompuart.pl>
> 
>>On Mon, Feb 03, 2003 at 01:50:00PM +0100, Bart Guijt wrote:
>>
>>>Hi all,
>>>
>>>I'm interested to see whether the following technique is useful for
> 
> Cocoon apps as well: compressing requested content if the client supports
> it. The article at the following link illustrates this best:
> 
>>use apache as an frontend and mod_gzip
>>
> 
> 
> Hmm. My project must provide a webapp for Websphere 4 AE. Does this work for
> Websphere as well?

gosh, if it's servlet 2.3 compliant, if they don't they have a serious 
problem.

  I know it uses an Apache frontend, I am not sure whether
> I am allowed to 'hack' this mod_gzip stuff into it.
> 
> Tomcat and Jetty are both containers supporting the 2.3 spec and thus
> supporting the filter setup. If I must use the servlet container to achieve
> compression instead of mod_gzip, I'd prefer to support it in the Cocoon
> framework rather than filters (for the sake of clarity, I guess).
> 
> I'll write a Serializer to try this out.

keep in mind that you have to tweak all serializers to do that if you go 
down that road.

-- 
Stefano Mazzocchi                               <st...@apache.org>
    Pluralitas non est ponenda sine neccesitate [William of Ockham]
--------------------------------------------------------------------



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


Re: Compressing output from Cocoon

Posted by Bart Guijt <b....@chello.nl>.
From: "Leszek Gawron" <ou...@kompuart.pl>
> On Mon, Feb 03, 2003 at 01:50:00PM +0100, Bart Guijt wrote:
> > Hi all,
> >
> > I'm interested to see whether the following technique is useful for
Cocoon apps as well: compressing requested content if the client supports
it. The article at the following link illustrates this best:
> use apache as an frontend and mod_gzip
>

Hmm. My project must provide a webapp for Websphere 4 AE. Does this work for
Websphere as well? I know it uses an Apache frontend, I am not sure whether
I am allowed to 'hack' this mod_gzip stuff into it.

Tomcat and Jetty are both containers supporting the 2.3 spec and thus
supporting the filter setup. If I must use the servlet container to achieve
compression instead of mod_gzip, I'd prefer to support it in the Cocoon
framework rather than filters (for the sake of clarity, I guess).

I'll write a Serializer to try this out.


Ciao,

BG


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


Re: Compressing output from Cocoon

Posted by Leszek Gawron <ou...@kompuart.pl>.
On Mon, Feb 03, 2003 at 01:50:00PM +0100, Bart Guijt wrote:
> Hi all,
> 
> I'm interested to see whether the following technique is useful for Cocoon apps as well: compressing requested content if the client supports it. The article at the following link illustrates this best:
> 
> 
>     http://www.servletsuite.com/servlets/compress.htm
> 
> 
> I browsed the Cocoon sources to see whether something like this was already implemented, but apparantly it's not.
> 
> Has anybody used this before? What are your experiences?
use apache as an frontend and mod_gzip

here is a piece of config from httpd.conf:

LoadModule gzip_module modules/ApacheModuleGzip.dll
[...]
AddModule mod_gzip.c
[...]
<IfModule mod_gzip.c>
	mod_gzip_on Yes
	mod_gzip_dechunk Yes
	mod_gzip_keep_workfiles No
	mod_gzip_temp_dir c:/temp

	mod_gzip_minimum_file_size  50
	mod_gzip_maximum_file_size  0
	mod_gzip_maximum_inmem_size 1000000


	mod_gzip_item_include mime text/.*
	mod_gzip_item_include file .*

	LogFormat "%h %l %u %t \"%V %r\" %>s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n Out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct." common_with_mod_gzip_info2
	CustomLog logs/mod_gzip.log  common_with_mod_gzip_info2
</IfModule>

To be able to use mod_gzip with POST requests you have to hack both ApacheCore and mod_gzip library
search google for "mod_gzip POST bug" and you will find an answer how. After patching it works like a charm.
	ouzo
-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/      ouzo@vip.net.pl          _\\()//_
         .'/()\'.     Phone: +48(600)341118     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


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


Re: Compressing output from Cocoon

Posted by Bill Barnhill <gw...@yahoo.com>.
Guess servlet filter is the way to go, sorry for being
clueless about existing code.

--- "Enke, Michael" <mi...@wincor-nixdorf.com>
wrote:
> Bart Guijt wrote:
> > 
> > Hi all,
> > 
> > I'm interested to see whether the following
> technique is useful for Cocoon apps as well:
> compressing requested content if the client supports
> it. The article at the following
> > link illustrates this best:
> > 
> > 
> >    
> http://www.servletsuite.com/servlets/compress.htm
> > 
> > 
> > I browsed the Cocoon sources to see whether
> something like this was already implemented, but
> apparantly it's not.
> > 
> > Has anybody used this before? What are your
> experiences?
> > 
> > 
> > Ciao,
> > 
> > Bart Guijt
> 
> 
> Put this lines into your web.xml:
> 
>   <filter>
>     <filter-name>Compression Filter</filter-name>
>    
>
<filter-class>compressionFilters.CompressionFilter</filter-class>
>     <init-param>
>       <param-name>compressionThreshold</param-name>
>       <param-value>10</param-value>
>     </init-param>
>   </filter>
>  
>   <filter-mapping>
>     <filter-name>Compression Filter</filter-name>
>     <url-pattern>*.gnumeric</url-pattern>
>   </filter-mapping>
>   <filter-mapping>
>     <filter-name>Compression Filter</filter-name>
>     <url-pattern>*.gz</url-pattern>
>   </filter-mapping>
> 
> If you use tomcat, put
> webapps/examples/WEB-INF/classes/compressionFilters
> into WEB-INF/classes
> 
> That's all.
> 
> It is submitted to bugzilla as a patch to web.xml.
> 
> Michael
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email:
> cocoon-dev-help@xml.apache.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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


Re: Compressing output from Cocoon

Posted by "Enke, Michael" <mi...@wincor-nixdorf.com>.
Bart Guijt wrote:
> 
> Hi all,
> 
> I'm interested to see whether the following technique is useful for Cocoon apps as well: compressing requested content if the client supports it. The article at the following
> link illustrates this best:
> 
> 
>     http://www.servletsuite.com/servlets/compress.htm
> 
> 
> I browsed the Cocoon sources to see whether something like this was already implemented, but apparantly it's not.
> 
> Has anybody used this before? What are your experiences?
> 
> 
> Ciao,
> 
> Bart Guijt


Put this lines into your web.xml:

  <filter>
    <filter-name>Compression Filter</filter-name>
    <filter-class>compressionFilters.CompressionFilter</filter-class>
    <init-param>
      <param-name>compressionThreshold</param-name>
      <param-value>10</param-value>
    </init-param>
  </filter>
 
  <filter-mapping>
    <filter-name>Compression Filter</filter-name>
    <url-pattern>*.gnumeric</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>Compression Filter</filter-name>
    <url-pattern>*.gz</url-pattern>
  </filter-mapping>

If you use tomcat, put webapps/examples/WEB-INF/classes/compressionFilters
into WEB-INF/classes

That's all.

It is submitted to bugzilla as a patch to web.xml.

Michael

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


Re: Compressing output from Cocoon

Posted by Leszek Gawron <ou...@kompuart.pl>.
On Tue, Feb 04, 2003 at 08:21:31AM +0100, Bart Guijt wrote:
> From: "Stefano Mazzocchi" <st...@apache.org>
> >
> > I haven't used it myself, but if I had to do it I would use servlet
> > filtering instead of patching cocoon. cocoon's concern is to create
> > output, http compression is part of the transport so it should be
> > somebody else's concern to modify the output to reshape it to improve
> > the transport.
> 
> Thanks Stefano, you've got a point there.
> 
> Since we use Websphere for production, I guess hacking mod_gzip into WAS is
> not going to make it (still waiting for a reply from the administrator) so I
> guess I should start looking at Servlet Filters then.
Why are you talking about 'hacking mod_gzip into websphere'? All you need is
an Apache frontend configured with mod_gzip. I do not know anything about
Websphere but if it uses Apache you just have to configure it properly

good news: there's a new version of mod_gzip which dose not contain POST bug
anymore
	ouzo
-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/      ouzo@vip.net.pl          _\\()//_
         .'/()\'.     Phone: +48(600)341118     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


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


Re: Compressing output from Cocoon

Posted by Bart Guijt <b....@chello.nl>.
From: "Stefano Mazzocchi" <st...@apache.org>
>
> I haven't used it myself, but if I had to do it I would use servlet
> filtering instead of patching cocoon. cocoon's concern is to create
> output, http compression is part of the transport so it should be
> somebody else's concern to modify the output to reshape it to improve
> the transport.

Thanks Stefano, you've got a point there.

Since we use Websphere for production, I guess hacking mod_gzip into WAS is
not going to make it (still waiting for a reply from the administrator) so I
guess I should start looking at Servlet Filters then.


Ciao,

Bart Guijt


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


Re: Compressing output from Cocoon

Posted by Stefano Mazzocchi <st...@apache.org>.
Bart Guijt wrote:
> Hi all,
>  
> I'm interested to see whether the following technique is useful for 
> Cocoon apps as well: compressing requested content if the client 
> supports it. The article at the following link illustrates this best:
>  
> 
>     http://www.servletsuite.com/servlets/compress.htm
>  
> 
> I browsed the Cocoon sources to see whether something like this was 
> already implemented, but apparantly it's not.

And IMO should not!

There are much better ways of doing this compression (thru servlet 
filtering or apache 2.0 module chaining)

> Has anybody used this before? What are your experiences?

I haven't used it myself, but if I had to do it I would use servlet 
filtering instead of patching cocoon. cocoon's concern is to create 
output, http compression is part of the transport so it should be 
somebody else's concern to modify the output to reshape it to improve 
the transport.

-- 
Stefano Mazzocchi                               <st...@apache.org>
    Pluralitas non est ponenda sine neccesitate [William of Ockham]
--------------------------------------------------------------------



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


Re: Compressing output from Cocoon

Posted by Bill Barnhill <gw...@yahoo.com>.
Would this be best implemented within Cocoon, or would
it best be implemented in a Servlet Filter? The filter
could be inserted after any web app, not just Cocoon. 

Bill Barnhill

--- Bart Guijt <b....@chello.nl> wrote:
> Hi all,
> 
> I'm interested to see whether the following
> technique is useful for Cocoon apps as well:
> compressing requested content if the client supports
> it. The article at the following link illustrates
> this best:
> 
> 
>    
> http://www.servletsuite.com/servlets/compress.htm
> 
> 
> I browsed the Cocoon sources to see whether
> something like this was already implemented, but
> apparantly it's not.
> 
> Has anybody used this before? What are your
> experiences?
> 
> 
> Ciao,
> 
> Bart Guijt
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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