Expires header vs Vary header

Hi,

I'm experiencing a somewhat strange behaviour involving "Vary" header, 
"Expires" header and 304 (not modified) responses.

Out server supports content that knows about its Expiry date, has strong 
Etags and indeed (potentielly) varies across a few request header 
dimensions.

I'm testing with Mozilla Firebird (using the excellent Live HTTP headers 
plugin).

After clearing all caches, the trace shows that Mozilla is GETting the 
resource, and that the response is a 200, including "Vary" and "Expires" 
(let's say 60 seconds in the future):

HTTP/1.x 200 OK
Date: Mon, 08 Dec 2003 17:37:13 GMT
Vary: accept-encoding, accept-language, cookie, user-agent, translate
Accept-Ranges: bytes
Etag: "942-1070891632000"
Last-Modified: Mon, 08 Dec 2003 13:53:52 GMT
Expires: Mon, 08 Dec 2003 17:38:13 GMT
Content-Type: image/gif
Content-Length: 942
Server: Apache Coyote/1.0

Continueing browsing, Mozilla indeed does not attempt any additional GET 
on that resource until the advertised expiry date has passed. When this 
happens, Mozilla sends a conditional GET...:

GET .../folder.gif HTTP/1.1
Host: 192.168.1.50:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) 
Gecko/20031007 Firebird/0.7
Accept: image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
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://192.168.1.50:8080/wcm/docs/cm/jr/leer/
Cookie: JSESSIONID=AA0E061A3B970E4AFC1BA61B8C973572
If-Modified-Since: Mon, 08 Dec 2003 13:53:52 GMT
If-None-Match: "942-1070891632000"
Authorization: Basic cmVzY2hrZTp3Y20xMjM0

returning...:

HTTP/1.x 304 Not Modified
Date: Mon, 08 Dec 2003 17:38:13 GMT
Vary: accept-encoding, accept-language, cookie, user-agent, translate
Etag: "942-1070891632000"
Expires: Mon, 08 Dec 2003 17:39:13 GMT
Server: Apache Coyote/1.0


Until now all is working as expected, however after receiving a 304 for 
the first time, Mozilla now issues the GET requests *every* time 
(instead of using the cached response for another 60 seconds).

Removing the "Vary" header from the responses "fixes" this behaviour. Am 
I missing an dependency between "Vary" and "Expires" (and/or possible 
strong ETags) I should be aware of?


Feedback appreciated,

Julian




-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

Received on Monday, 8 December 2003 12:48:29 UTC