Subject: Re: Issue 39: proposed example for varying the etag based on conneg

From: Henrik Nordström <[email-masked]>
Date: Tue, 04 May 2010 01:21:39 +0200

tis 2010-04-06 klockan 16:41 +0100 skrev Nathan:

> Is this a change in semantics which the server considers to be
> equivalent (semantically), or should/must the representation equivalence
> be considered from a user-agent / cache perspective.
> 
> Would two representations with different content-encodings and character
> encodings be valid replacements for each other at a cache?

Any change in properties which would make the response incompatible with
different is not semantically equivalent.

It does not matter which axis this property change is on, be it
Content-Encoding, charset, Content-Type, etc.

Only changes which do not change response compatibility can be
considered equivalent, such as changes in compression level, xml
formatting, or even any of the above when done based on other parameters
than the request such as local server configuraton (i.e. default charset
setting when reading files from filesystem).

> "weak validators allow for more efficient caching of equivalent objects"

Yes, as only the first response will get cached and then reused for all
subsequent requests where the serer says the weak etag matches.

Weak etags just need to be unique enough that the server can say "yes,
whatever you have cached earlier with that etag is valid as response for
this other request you sent me now".

Regards
Henrik

---

From: Henrik Nordström <[email-masked]>
Date: Tue, 04 May 2010 01:31:52 +0200

tis 2010-04-06 klockan 17:37 +0200 skrev Julian Reschke:

> > A weak entity tag SHOULD change whenever the origin server considers prior representations to be unacceptable as a substitute for the current representation. In other words, an entity tag SHOULD change whenever the origin server wants caches to invalidate old responses.

True, and gets more obvious if you look at what happens when content
negotiation is used on the resource.

Any responses with matching ETag must be fully interchangeable with
another having the same ETag. No matter if weak or strong.

Two responses which are not fully interchangeable MUST NOT use the same
ETag.

Responses which are fully interchangeable but which perhaps do not share
the same binary representation MAY use a shared weak ETag.

Regards
Henrik