You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Romain Larvet <rl...@netfinca.com> on 2011/03/22 11:40:13 UTC

GZIP Compression - Server Side configuration

Hello,

 

I would like to add gzip compression to my axis2 services on server-side and
can't find how to do this. Can someone help?

 

Here is what I tried:

1)      Service code : I added the following code to my service in the
generated skeleton:

      MessageContext messageContext =
MessageContext.getCurrentMessageContext();

      messageContext.setProperty(HTTPConstants.MC_GZIP_RESPONSE,
Boolean.TRUE);

messageContext.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);

 

2)      Tomcat config : I also tried to modify the server.xml file as
follows:

    <Connector

           port="8080" maxHttpHeaderSize="8192"

           maxThreads="150" minSpareThreads="2" maxSpareThreads="75"

           enableLookups="false" redirectPort="8443" 

           acceptCount="100" connectionTimeout="20000" 

           disableUploadTimeout="true"

           compression="on" compressionMinSize="1" 

           noCompressionUserAgents="gozilla, traviata" 

           compressableMimeType="text/html,text/xml"

           />

 

Even with this config, when I monitor requests and responses with Eclipse
TCP/IP Monitor I see no compression in the message content, and I don't see
the header Content-Encoding : gzip 

 

Can you tell me if I forgot something?

 

Thanks in advance for your help,

Romain Larvet

 


RE: GZIP Compression - Server Side configuration

Posted by Romain Larvet <rl...@netfinca.com>.
Hello,

 

Does anyone have an idea to help solve my problem ?

 

Thanks,

Romain Larvet

 

De : Romain Larvet [mailto:rlarvet@netfinca.com] 
Envoyé : mardi 22 mars 2011 11:40
À : java-user@axis.apache.org
Objet : GZIP Compression - Server Side configuration

 

Hello,

 

I would like to add gzip compression to my axis2 services on server-side and
can’t find how to do this. Can someone help?

 

Here is what I tried:

1)      Service code : I added the following code to my service in the
generated skeleton:

      MessageContext messageContext =
MessageContext.getCurrentMessageContext();

      messageContext.setProperty(HTTPConstants.MC_GZIP_RESPONSE,
Boolean.TRUE);

messageContext.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);

 

2)      Tomcat config : I also tried to modify the server.xml file as
follows:

    <Connector

           port="8080" maxHttpHeaderSize="8192"

           maxThreads="150" minSpareThreads="2" maxSpareThreads="75"

           enableLookups="false" redirectPort="8443" 

           acceptCount="100" connectionTimeout="20000" 

           disableUploadTimeout="true"

           compression="on" compressionMinSize="1" 

           noCompressionUserAgents="gozilla, traviata" 

           compressableMimeType="text/html,text/xml"

           />

 

Even with this config, when I monitor requests and responses with Eclipse
TCP/IP Monitor I see no compression in the message content, and I don’t see
the header Content-Encoding : gzip 

 

Can you tell me if I forgot something?

 

Thanks in advance for your help,

Romain Larvet