Subject: 304 reponse with unrecognised ETag

From: Adrien de Croy <[email-masked]>
Date: Fri, 19 Jun 2009 22:38:26 +1200

Hi

I'm seeing a few problem sites, where the server replies with a 304 to a 
conditional request, but the ETag doesn't match any known ETag.  E.g 
from a packet capture:

GET /economics/charts/nzdusd_1_hourly.gif HTTP/1.1
Host: www.nationalbank.co.nz
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) 
AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.31 Safari/530.5
Referer: http://www.nationalbank.co.nz/economics/exchange/nzdusd.aspx
Accept: */*
Accept-Encoding: gzip,deflate,bzip2,sdch
Cookie: s_vi=[CS]v1|499E6E6A00006868-A0208AF00000004[CE]; 
s_nr=1244358115085; s_cc=true; s_sq=%5B%5BB%5D%5D
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
If-Modified-Since: Fri, 19 Jun 2009 10:19:38 GMT
If-None-Match: "8042c973c7f0c91:64e6"
Connection: Keep-Alive

HTTP/1.1 304 Not Modified
Server: Microsoft-IIS/5.0
Date: Fri, 19 Jun 2009 10:27:31 GMT
X-Powered-By: ASP.NET
Cache-Control: no-cache
Expires: Fri, 19 Jun 2009 10:27:31 GMT
ETag: "08de660c7f0c91:6a9f"
Content-Length: 0

Apart from the known IIS bug with Content-Length: 0, how is an 
intermediary cache to deal with this?

Is it allowable to change an ETag on a stored representation?  Isn't the 
whole point of an ETag that it uniquely identifies a rep, and so a 
different ETag means a different representation?

The 304 is pretty clear, whatever the client asked for hasn't changed.  
But what if there were more than one ETag in the request?  Which stored 
representation would one update?  the latest?

Does this mean it's generally a really bad idea to have more than 1 Etag 
in a If-None-Match header, or at least more than 1 added by an 
intermediary cache?  IOW is it a really bad idea for an intermediary to 
try and use If-None-Match to see which stored representation is the one 
that's still valid?

In terms of the spec, it says you must always serve the stored rep with 
the latest Date header, but what about for revalidation?

Thanks

Adrien

-- 
Adrien de Croy - WinGate Proxy Server - http://www.wingate.com

---

From: Henrik Nordstrom <[email-masked]>
Date: Thu, 25 Jun 2009 00:32:09 +0200

> intermediary cache to deal with this?

P4 3.1 304 Not Modified

"If a 304 response indicates an entity not currently cached, then the
cache MUST disregard the response and repeat the request without the
conditional."

However, it's my understanding that if the conditional wasn't added by
the cache then it may just as well invalidate the cached response(s) and
relay received 304 response without repeating the request.

> Is it allowable to change an ETag on a stored representation?

Never ever.

> representation would one update?  the latest?

None. See above.

> intermediary cache?

No. Most servers do get this correct.

> IOW is it a really bad idea for an intermediary to 

No. It's required that the intermediary do this.

On a side note I should mention that I know that at least one of the
major servers in use today is broken in this regard and only expects a
single etag in If-None-Match, processing If-None-Match as a string
literal instead of list, but this only gives a soft degradation in that
the conditional then never matches and is not considered harmful.

Regards
Henrik