tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael <sg...@gmx.net>
Subject Re: HTTP Connector GZIP compression
Date Sun, 05 Apr 2009 18:46:27 GMT
Caldarale, Charles R wrote:
>> From: Michael [mailto:sgfan@gmx.net]
>> Subject: Re: HTTP Connector GZIP compression
>>
>> 1. lorem.jsp: 72 726  bytes
>> 2. prototype.js: 134.057  bytes
>>
>> According to the above setting only the JS file should be compressed.
> 
> No; response from the .jsp will also be compressed if the return type is html - which
it almost always is for JSPs.

Well, I was not refering to the mime type but to the file size. I set 
the threshold to 80 000 bytes. No compression should happen below 80 000 
bytes. Did I missunderstand something here?

>> HTTP/1.1 200 OK
>> Content-Type: text/html;charset=UTF-8
>> Transfer-Encoding: chunked
>> Content-Encoding: gzip
> 
>> Regarding number 1: this is compressed although I set 
>> threshold to 80000 bytes
> 
> Note the Transfer-Encoding of chunked along with this sentence from the doc:
> 
> "If the content-length is not known and compression is set to 'on' or more aggressive,
the output will also be compressed."

Ok, understood. What is the rationale for? Is there a good reason to 
compress anyway?

>> HTTP/1.1 200 OK
>> Content-Type: text/javascript
>> Content-Length: 134057
>>
>> Regarding number 2: the Javascript ist not compressed!
> 
> That does seem to be a problem; check your server.xml again now that you've removed the
undefined attribute.

Checked, the server.xml remains the same. I did not alter it except the 
invalid attribute. The same happens for CSS too.

>> No I turn compression off:
>>
>> #  Result  Protocol  Host            URL                   Body
>> 0   200	 HTTP      localhost:8080  /java-demo/lorem.jsp  19665
>>
>> Caching  Content-Type             Process
>>          text/html;charset=UTF-8  firefox:500
>>
>> lorem.jsp still compressed: WTF
> 
> Why do you think the output of lorem.jsp is compressed this time?

The simple reason is that I have disabled compression completely and the 
uncompressed size is 72 726 bytes. But 19 665 bytes have been sent over 
the wire which means I has beeen compressed anyway.

Thanks again,

Mike


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


Mime
View raw message