Re: 3 short questions, Entity Tag & Content Location

sön 2010-03-14 klockan 17:10 +0000 skrev Nathan:

> no hence why I was asking, because it appeared to conflict with the 3xx
> range and conneg; indicating that I could essentially do conneg with a
> 200 OK + Content Location.

3xx is using Location, not Content-Location.

In HTTP there is two forms of content negotiation. Server driven ws
client driven. Server driven is the server selecting which
representation to respond with for this request, usually in an 2xx
response. Client driven is when the client is given information about
the available choices via a 3xx response and asked to request one of
those instead.

Please note that a 3xx response that in itself is negotiated is also a
server driven content negotiated resource, and need to obey to the rules
of such. Most importably Vary should be used here to indicate what was
used as input by the server to the negoaiation process, and the ETag
uniqueness where applicable (mainly 304, which is a special case 3xx
response code, not really a redirection as such).

Content-Location is primarily used for 2xx responses (server driven
content negotiation) and indicates a location where the resource of the
current response can be accessed directly, which may be different from
the current requested URI, or should be different if the response is
based on server driven content negotiation.

3xx redirects to another resource, for which there may be another
request initiated by the requesting client. Location when used indicates
the preferred choice among the available choices but it's ultimately up
to the client to decide if this should be requested. 

> > Entity tags are unique only per URI; so they could, but they don't have to.
> 
> What about cache's giving back the wrong media-type, would a change in
> media-type be a semantic change of such magnitude that a weak entity tag
> couldn't be used (or would be misleading)?

Yes, but again that's relating to responses to a single URI only. If you
have and use unique URIs per media type then you are not bound by this
when deciding what ETag to use for responses to those URIs. But I would
recommend using different ETags anyhow if possible as you may want to
merge those resources in a single server driven content negotiated URI
resource.

Regards
Henrik

Received on Sunday, 9 May 2010 12:47:47 UTC