W3C home > Mailing lists > Public > ietf-http-wg@w3.org > October to December 2003

Expires header vs Vary header

From: Julian Reschke <julian.reschke@gmx.de>
Date: Mon, 08 Dec 2003 18:48:26 +0100
Message-ID: <3FD4B96A.5020104@gmx.de>
To: ietf-http-wg@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 06:49:25 GMT