I am using Tomcat to compress my HTML content like this:
<Connector port="8080" maxHttpHeaderSize="8192"
maxProcessors="150" maxThreads="150" minSpareThreads="25"
maxSpareThreads="75" enableLookups="false" redirectPort="8443"
acceptCount="150" connectionTimeout="20000" disableUploadTimeout="true"
compression="on" compressionMinSize="128" noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html"
URIEncoding="UTF-8" />
In the HTTP header (as observed via YSlow), however, I am not seeing
Content-Encoding: gzip
resulting in a poor YSlow score.
All I see is
HeadersPost
Response Headers
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Language: en-US
Content-Length: 5251
Date: Sat, 14 Feb 2009 23:33:51 GMT
I am running an apache mod_jk Tomcat configuration.
How do I compress HTML content with Tomcat, and also have it add "Content-Encoding: gzip" in the header?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…