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 17:02:57 GMT
Caldarale, Charles R wrote:
>> From: Michael [mailto:sgfan@gmx.net]
>> Subject: Re: HTTP Connector GZIP compression
>>
>> this is my server.xml: http://www.pastie.org/437454
> 
> Other than having <Context> elements in there, the only other obviously wrong item
is the compressionMinSize attribute; there isn't one for a <Connector>.

Correct, I removed that element.

>> CompressionMinSize is given bytes, isn't it?
> 
> There's no such attribute for a <Connector>, so your question is moot.  Read the
doc:
> http://tomcat.apache.org/tomcat-5.5-doc/config/http.html#Standard%20Implementation
> 
> You are testing through port 8080, aren't you?  I don't see any problems with compression
on 5.5.27 when testing on my laptop; I see a header of "Content-Encoding: gzip" on all appropriate
responses.
> 
> You need to supply the URLs you're using and the response headers as seen by the browser.
 (Live HTTP headers for Firefox is good for this.)  

Yes, I am on port 8080. Local testing.

I have altered the Connctor to:
-------------------------------------
     <Connector compression="80000"
	compressableMimeType="text/html,text/javascript" URIEncoding="UTF-8"
	acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true"
	enableLookups="false" maxHttpHeaderSize="8192" maxSpareThreads="75"
	maxThreads="150" minSpareThreads="25" port="8080" redirectPort="8443" />
-------------------------------------

I have two testfiles on my server:

1. lorem.jsp: 72 726  bytes
2. prototype.js: 134.057  bytes

According to the above setting only the JS file should be compressed. 
Inspecting the requests with Fiddler and Firebug (caches cleared) 
results in:
1. lorem.jsp:
#	Result	Protocol	Host	URL	Body	Caching	Content-Type	Process	Comments 
Custom	
0	200	HTTP	localhost:8080	/java-demo/lorem.jsp	19 665	 
text/html;charset=UTF-8	firefox:500			

GET /java-demo/lorem.jsp HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) 
Gecko/2009032609 Firefox/3.0.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-DE,de;q=0.8,nl-NL;q=0.6,nl;q=0.4
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: JSESSIONID=E0EEB796A88FECFE98882E37EB499565


HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Content-Encoding: gzip
Vary: Accept-Encoding
Date: Sun, 05 Apr 2009 16:57:07 GMT

a
�

2. prototype.js:
#	Result	Protocol	Host	URL	Body	Caching	Content-Type	Process	Comments 
Custom	
1	200	HTTP	localhost:8080	/java-demo/prototype.js	134 057	 
text/javascript	firefox:500			
GET /java-demo/prototype.js HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) 
Gecko/2009032609 Firefox/3.0.8
Accept: */*
Accept-Language: de-DE,de;q=0.8,nl-NL;q=0.6,nl;q=0.4
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://localhost:8080/java-demo/lorem.jsp
Cookie: JSESSIONID=E0EEB796A88FECFE98882E37EB499565


HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
ETag: W/"134057-1238784461906"
Last-Modified: Fri, 03 Apr 2009 18:47:41 GMT
Content-Type: text/javascript
Content-Length: 134057
Date: Sun, 05 Apr 2009 16:57:07 GMT

[body omitted]



Regarding number 1: this is compressed although I set threshold to 80 
000 bytes
Regarding number 2: the Javascript ist not compressed!

No I turn compression off:

#	Result	Protocol	Host	URL	Body	Caching	Content-Type	Process	Comments 
Custom	
0	200	HTTP	localhost:8080	/java-demo/lorem.jsp	19 665	 
text/html;charset=UTF-8	firefox:500			

#	Result	Protocol	Host	URL	Body	Caching	Content-Type	Process	Comments 
Custom	
1	200	HTTP	localhost:8080	/java-demo/prototype.js	134 057	 
text/javascript	firefox:500			


lorem.jsp still compressed: WTF

This is really weird, I simply do *not* unterstand the compression logic.

Thanks,

Mike


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


Mime
View raw message