You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Akash Jain <ak...@gmail.com> on 2014/02/19 01:45:24 UTC

GZIP support in Tomcat 7

I have following configuration in my server.xml :

<Connector port="19380"
               protocol="HTTP/1.1"
               compression="on"
               compressableMimeType="text/
html,text/xml,text/plain,application/javascript,application/json,text/javascript,text/json"
               connectionTimeout="20000"
               redirectPort="8443" />
But still when I am checking for JS/CSS files in browser, the size returned
is not less.

Can anybody guide as to what I am missing here.

Re: GZIP support in Tomcat 7

Posted by Dhaval Jaiswal <dh...@via.com>.
Can you add below entry and check.

text/css.

Just give a try for the below too and revert with result.

application/js,
text/js


You can add compressionMinSize if you want.



On Wed, Feb 19, 2014 at 6:15 AM, Akash Jain <ak...@gmail.com> wrote:

> I have following configuration in my server.xml :
>
> <Connector port="19380"
>                protocol="HTTP/1.1"
>                compression="on"
>                compressableMimeType="text/
>
> html,text/xml,text/plain,application/javascript,application/json,text/javascript,text/json"
>                connectionTimeout="20000"
>                redirectPort="8443" />
> But still when I am checking for JS/CSS files in browser, the size returned
> is not less.
>
> Can anybody guide as to what I am missing here.
>

Re: GZIP support in Tomcat 7

Posted by André Warnier <aw...@ice-sa.com>.
Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Akash,
> 
> On 2/18/14, 7:45 PM, Akash Jain wrote:
>> I have following configuration in my server.xml :
>>
>> <Connector port="19380" protocol="HTTP/1.1" compression="on" 
>> compressableMimeType="text/ 
>> html,text/xml,text/plain,application/javascript,application/json,text/javascript,text/json"
>>
>>
> connectionTimeout="20000"
>> redirectPort="8443" /> But still when I am checking for JS/CSS
>> files in browser, the size returned is not less.
>>
>> Can anybody guide as to what I am missing here.
> 
> How are you checking the "size" returned?
> 
> Can you provide full request and response headers of an example request?
> 

Also this ?
http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#Standard_Implementation

compressionMinSize	

If compression is set to "on" then this attribute may be used to specify the minimum 
amount of data before the output is compressed. If not specified, this attribute is 
defaults to "2048".

.. and the note about using "sendFile", just above ?


There seems to be quite an amount of potential interaction between the various 
"compression"* and "sendfile"* attributes, also depending on the Connector being used, and 
whether it is APR or not.  Maybe we're in one of those cases here ?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: GZIP support in Tomcat 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Akash,

On 2/18/14, 7:45 PM, Akash Jain wrote:
> I have following configuration in my server.xml :
> 
> <Connector port="19380" protocol="HTTP/1.1" compression="on" 
> compressableMimeType="text/ 
> html,text/xml,text/plain,application/javascript,application/json,text/javascript,text/json"
>
> 
connectionTimeout="20000"
> redirectPort="8443" /> But still when I am checking for JS/CSS
> files in browser, the size returned is not less.
> 
> Can anybody guide as to what I am missing here.

How are you checking the "size" returned?

Can you provide full request and response headers of an example request?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTBAaDAAoJEBzwKT+lPKRYfGsQALZlBaG3McbYLFV5uzuv/mmC
8oWyqtMPu9gwe/AGW35gM7NlkktV+rMNmwqUV2BNyBkKXg8+Wg08t1sQADxxKiRE
KMO0O95CLTT+OB8pNB2TV5UmvM5VI5WasJsDqUhD2z0n3ah8s5shhx+Vdx/dYqVE
ncgE4izMSD3xpePrmZCwTBjiOTeAATdzMFE59EJlAKloWd0XBU3xb5LDMHjJJQsr
HWxTrJPE6oT+ibdLUKX3yJCjDx2g0GifcQvELFDIqVXsEtqzbwwkB/jZYcOK7yx3
inVU/vAa9fH1sXPTgqtXxhrV7GdjYUMWJAYE0+rIbAfYN6pJpkABAGwLIRK2Exhk
BLcCB4a+r/fjeGqA9knayCglTyCZovJI5yBnvxYptFFoLhd4rgZxDnBP6m+Nf5bR
dVZZgAsdm+WsBK+QwQ6FLWdNGIz7CRBIDwh+lS+UqskqJLKS1Ap6TCPeXF3cGXrN
//lH/pmsUao471LQROuCOPdyXvU/amQn3FHqfY/PI6/G1j1S2m16K2XzntXa3YZm
G7opLKCkPScUjP+wIgTXXMhDO9qMKukOQMl9eXMHt+JiHuxUFvrtHFgkglI4jjOz
H1MX5/XV+RXeusqxkFYgvYM0+wVaNYJXqcXGjJFky1gjHhy4nfkYVic4qhk4VXs+
hBWIe2tlH972obrWJdI1
=HLFi
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org