tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Tomcat 6.0 GZIP Compression not working for large js files
Date Thu, 13 Jan 2011 21:29:48 GMT
Hash: SHA1


On 1/13/2011 3:04 PM, Ran Berenfeld wrote:
> I'm using tomcat 6 for a deployed website (
> and since the beginning, GZIP compression did not work for part of the
> files.


What specific version of Tomcat 6?

> the amazing thing is that the website have several javascript files, some
> quite small
> and some large, and the HTTP headers (for example when viewed using Firefox
> "Live HTTP Headers" plugin) clearly shows that the compression works only
> for the small
> js file, and not for the large file.

So it /does/ work for the small files? Good.

> I tried "playing" with the <Connector> at server.xml many times, and nothing
> works.
> Finally, I just added an external Gzip Tomcat Filter (and that solved the
> problem...)
> Here's the relevant part of my server.xml :
>    <Connector port="80" protocol="HTTP/1.1"
>         compression="1400"

Can you confirm that .js files smaller than 1400 bytes are not
compressed? Just trying to triple-check your configuration.

> compressableMimeType="text/html,text/css,text/javascript"

Can you confirm that all your files' MIME types are text/javascript?

>         URIEncoding="UTF-8"
>         threadPriority="10"/>

Is there a reason you changed the priority of the threads? Presumably,
your request processing threads represent nearly all of the threads
running in the JVM. If they're all at MAX_PRIORITY, you're not really
gaining anything.

What else can you tell us about these "large" Javascript files? Are they
static files loaded directly from the disk, or are they
dynamically-generated? Are you sure that thee content-type is being set
correctly for these files?

Are you using Tomcat standalone or do you have something in front, such
as Apache httpd? Just making sure that Tomcat is doing the compression
for you.

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message