Bug 49625 - Tomcat doesn't send Vary consistently when gzip enabled
Tomcat doesn't send Vary consistently when gzip enabled
Status: RESOLVED FIXED
Product: Tomcat 6
Classification: Unclassified
Component: Connectors
6.0.28
PC Linux
: P2 normal (vote)
: default
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-07-21 03:11 UTC by Ferenc Lutischan
Modified: 2010-11-03 15:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ferenc Lutischan 2010-07-21 03:11:07 UTC
HTTP requires that the Vary response header be sent consistently for all responses if they change based upon different aspects of the request.
My pages has both compressed and uncompressed variants available, negotiated by the Accept-Encoding request header, but it sends different Vary headers for each;

"accept-encoding" when the response is compressed, and
"" when it is not.
This can cause problems for downstream caches, because they cannot consistently determine what the cache key for a given URI is.

My server.xml content:
  <Service name="Catalina">
  
    <Connector port="8080" proxyPort="80" maxHttpHeaderSize="8192" protocol="org.apache.coyote.http11.Http11Protocol" 
    maxThreads="200" minSpareThreads="25" maxPostSize="8" 
    maxSpareThreads="75" enableLookups="false" keepAliveTimeout="3000" maxKeepAliveRequests="100"
    redirectPort="8443" acceptCount="100"
    connectionTimeout="8000" disableUploadTimeout="true"
    compression="on" compressionMinSize="2048"
    compressableMimeType="text/html,text/xml,text/javascript,text/css" />
    
    <Engine name="Catalina" defaultHost="localhost">
        <Host name="localhost" appBase="webapps" unpackWARs="false" autoDeploy="false"
debug="0"
            xmlValidation="false" xmlNamespaceAware="false">
	</Host>
    </Engine>
  </Service>
Comment 1 Ferenc Lutischan 2010-07-21 07:33:47 UTC
A test url:
http://redbot.org/?uri=http://dictzone.com/english-german-dictionary/
Comment 2 Mark Thomas 2010-09-28 08:11:24 UTC
This has been fixed in trunk and will be included in 7.0.3 onwards.

The fix has been proposed for back-port to 6.0.x.
Comment 3 Mark Thomas 2010-11-03 15:05:29 UTC
Fixed in 6.0.x and will be included in 6.0.30 onwards.