You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Caron <ca...@unidata.ucar.edu> on 2007/12/09 16:43:34 UTC

Is compress working? No Content-Encoding header

I tried to enable compression in Tomcat 6.0.10:

    <Connector port="9080" protocol="HTTP/1.1"
        maxThreads="50" connectionTimeout="20000" redirectPort="9443"
        compression="on"
        compressableMimeType="text/html,text/xml,text/plain,application/xml,application/octet-stream,application/x-netcdf" />

Now I am trying to see if that is working. I am using the Live HTTP Headers plugin for Firefox, which shows me the HTTP headers. For simplicity, I just make a request for a static html page, namely one of the tomcat docs:

http://motherlode.ucar.edu:9080/docs/logging.html

 GET /docs/logging.html HTTP/1.1
 Host: motherlode.ucar.edu:9080
 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
 Accept-Language: en-us,en;q=0.5
 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://motherlode.ucar.edu:9080/docs/introduction.html


 HTTP/1.x 200 OK
 Server: Apache-Coyote/1.1
 Etag: W/"22376-1182289456000"
 Last-Modified: Tue, 19 Jun 2007 21:44:16 GMT
 Content-Type: text/html
 Content-Length: 22376
 Date: Sun, 09 Dec 2007 15:35:25 GMT


I would expect to see a header in the response:

 Content-Encoding: gzip

but its missing. I assume this means that the content is not compressed.

I also tried compression="force" to no avail. Also, I wonder what this sentance means: "If the content-length is not known and compression is set to "on" or more aggressive, the output will also be compressed". What does the output refer to? The "also" implies something else besides the output?

thanks for any help...



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


Re: Is compress working? No Content-Encoding header

Posted by Martin Gainty <mg...@hotmail.com>.
John-

did your browser request Accept-Encoding: * ?
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

get fiddler for determining values of HTTP Headers
http://www.fiddlertool.com/fiddler/

If possible can you publish the service to the outside world so we can see
this malady is specific to a Browser?

Thanks/
Martin--
----- Original Message -----
From: "John Caron" <ca...@unidata.ucar.edu>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, December 20, 2007 3:24 PM
Subject: Re: Is compress working? No Content-Encoding header


> It seems bizarre, but it appears that the "Accept-Encoding" header is
> being lost somewhere on route from my home computer. running this test
> on my work computer works fine. sorry for the noise.
>
> Caldarale, Charles R wrote:
> >> From: John Caron [mailto:caron@unidata.ucar.edu]
> >> Subject: Is compress working? No Content-Encoding header
> >>
> >> I tried to enable compression in Tomcat 6.0.10:
> >
> > I just tried the same thing in 6.0.14 with no problems, retrieving the
> > same page that you tried.
> >
> > Connector config:
> >   <Connector port="8080" protocol="HTTP/1.1"
> >              compression="on"
> >
> > compressableMimeType="text/html,text/xml,text/plain,application/xml,appl
> > ication/octet-stream,application/x-netcdf"
> >              connectionTimeout="20000"
> >              redirectPort="8443" />
> >
> > Request headers:
> >   GET /docs/logging.html HTTP/1.1
> >   Host: localhost:8080
> >   User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
> > rv:1.8.1.11)
> >     Gecko/20071127 Firefox/2.0.0.11
> >   Accept:
> > text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,
> >     text/plain;q=0.8,image/png,*/*;q=0.5
> >   Accept-Language: en-us,en;q=0.5
> >   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/docs/
> >
> > Response headers:
> >   HTTP/1.x 200 OK
> >   Server: Apache-Coyote/1.1
> >   Etag: W/"22385-1184923216000"
> >   Last-Modified: Fri, 20 Jul 2007 09:20:16 GMT
> >   Content-Type: text/html
> >   Transfer-Encoding: chunked
> >   Content-Encoding: gzip
> >   Vary: Accept-Encoding
> >   Date: Sun, 09 Dec 2007 16:31:21 GMT
> >
> > If you haven't already done so, you might try clearing the Firefox
> > cache, but that shouldn't matter since you're seeing a 200, not 304.
> >
> > You could try it again on 6.0.14.
> >
> > Are they any semi-clever boxes between your browser and
> > motherlode.ucar.edu that might be caching responses?
> >
> >  - Chuck
> >
> >
> > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> > MATERIAL and is thus for use only by the intended recipient. If you
> > received this in error, please contact the sender and delete the e-mail
> > and its attachments from all computers.
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


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


Re: Is compress working? No Content-Encoding header

Posted by John Caron <ca...@unidata.ucar.edu>.
It seems bizarre, but it appears that the "Accept-Encoding" header is
being lost somewhere on route from my home computer. running this test
on my work computer works fine. sorry for the noise.

Caldarale, Charles R wrote:
>> From: John Caron [mailto:caron@unidata.ucar.edu] 
>> Subject: Is compress working? No Content-Encoding header
>>
>> I tried to enable compression in Tomcat 6.0.10:
> 
> I just tried the same thing in 6.0.14 with no problems, retrieving the
> same page that you tried.
> 
> Connector config:
>   <Connector port="8080" protocol="HTTP/1.1"
>              compression="on"
>  
> compressableMimeType="text/html,text/xml,text/plain,application/xml,appl
> ication/octet-stream,application/x-netcdf"
>              connectionTimeout="20000"
>              redirectPort="8443" />
> 
> Request headers:
>   GET /docs/logging.html HTTP/1.1
>   Host: localhost:8080
>   User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
> rv:1.8.1.11)
>     Gecko/20071127 Firefox/2.0.0.11
>   Accept:
> text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,
>     text/plain;q=0.8,image/png,*/*;q=0.5
>   Accept-Language: en-us,en;q=0.5
>   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/docs/
> 
> Response headers:
>   HTTP/1.x 200 OK
>   Server: Apache-Coyote/1.1
>   Etag: W/"22385-1184923216000"
>   Last-Modified: Fri, 20 Jul 2007 09:20:16 GMT
>   Content-Type: text/html
>   Transfer-Encoding: chunked
>   Content-Encoding: gzip
>   Vary: Accept-Encoding
>   Date: Sun, 09 Dec 2007 16:31:21 GMT
> 
> If you haven't already done so, you might try clearing the Firefox
> cache, but that shouldn't matter since you're seeing a 200, not 304.
> 
> You could try it again on 6.0.14.
> 
> Are they any semi-clever boxes between your browser and
> motherlode.ucar.edu that might be caching responses?
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org

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


RE: Is compress working? No Content-Encoding header

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: John Caron [mailto:caron@unidata.ucar.edu] 
> Subject: Is compress working? No Content-Encoding header
> 
> I tried to enable compression in Tomcat 6.0.10:

I just tried the same thing in 6.0.14 with no problems, retrieving the
same page that you tried.

Connector config:
  <Connector port="8080" protocol="HTTP/1.1"
             compression="on"
 
compressableMimeType="text/html,text/xml,text/plain,application/xml,appl
ication/octet-stream,application/x-netcdf"
             connectionTimeout="20000"
             redirectPort="8443" />

Request headers:
  GET /docs/logging.html HTTP/1.1
  Host: localhost:8080
  User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.1.11)
    Gecko/20071127 Firefox/2.0.0.11
  Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,
    text/plain;q=0.8,image/png,*/*;q=0.5
  Accept-Language: en-us,en;q=0.5
  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/docs/

Response headers:
  HTTP/1.x 200 OK
  Server: Apache-Coyote/1.1
  Etag: W/"22385-1184923216000"
  Last-Modified: Fri, 20 Jul 2007 09:20:16 GMT
  Content-Type: text/html
  Transfer-Encoding: chunked
  Content-Encoding: gzip
  Vary: Accept-Encoding
  Date: Sun, 09 Dec 2007 16:31:21 GMT

If you haven't already done so, you might try clearing the Firefox
cache, but that shouldn't matter since you're seeing a 200, not 304.

You could try it again on 6.0.14.

Are they any semi-clever boxes between your browser and
motherlode.ucar.edu that might be caching responses?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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