Re: Is 303 really necessary?

On Mon, 2010-11-08 at 10:11 +0000, Toby Inkster wrote:
> On Thu, 4 Nov 2010 13:22:09 +0000
> Ian Davis <me@iandavis.com> wrote:
> 
> > http://iand.posterous.com/is-303-really-necessary
> 
> Ian brings up numerous difficulties with 303 responses.
> 
> The two biggest issues in my opinion are:
> 
>  1. 303s can be tricky to configure unless you know your
>     way around the server environment you're using, and
>     have sufficient permissions on the server; and
> 
>  2. They require an additional HTTP request to get to the
>     data the client actually wants.
> 
> I think that without using RDF-specific publishing platforms (think
> WordPress for Linked Data) #1 is always going to be a difficulty.

Why not use a 303-redirect service such as
http://thing-described-by.org/ or http://t-d-b.org/ ?  That makes it
trivially easy to do 303 redirects.  No configuration needed!  And if
you want to run your own 303 redirect service, you can view all of the
code and configuration files here:
http://thing-described-by.org/?showfile=. 

> Even if we accept 200 OK as a response code for non-IR resources, this
> only solves part of the server configuration problem. There are still
> other issues to be solved - Apache doesn't come preconfigured with
> media type information for N3/Turtle/N-Triples. And getting
> neat-looking URIs (no ".rdf" suffix at the end) requires something like
> mod_rewrite, Apache multiviews or ForceType to be configured. You could
> try publishing an N-Triples file with no suffix, and cross your fingers
> that Apache's default media type of "text/plain" will bubble up.
> 
> #2 on the other hand can be addressed quite easily. 303 responses are
> allowed -- indeed encouraged -- to include an entity body. Servers
> could be configured to duplicate the description of the non-IR resource
> in this entity body. 

Yes, the 303 response could include the entire toucan description.  RFC
2616 says:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4
"the entity of the response SHOULD contain a short hypertext note with a
hyperlink to the new URI(s)".   The entire toucan description might be
more than a "short hypertext note", but this is a "SHOULD" requirement
-- not a "MUST" requirement:
http://www.ietf.org/rfc/rfc2119.txt
[[
3. SHOULD   This word, or the adjective "RECOMMENDED", mean that there
   may exist valid reasons in particular circumstances to ignore a
   particular item, but the full implications must be understood and
   carefully weighed before choosing a different course.
]]

Furthermore, to avoid server configuration difficulties, this ability
could be combined with a 303-redirect service such as http://t-d-b.org/
such that a GET on a URI like the following

  http://t-d-b.org/cache?http://iandavis.com/2010/303/toucan.rdf

could directly return the whole toucan description from
http://iandavis.com/2010/303/toucan.rdf :

  HTTP/1.1 303 See Other
  Location: http://iandavis.com/2010/303/toucan.rdf
  Content-Location: http://iandavis.com/2010/303/toucan.rdf
  Content-Type: application/rdf+xml

  <?xml version="1.0"?>
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    . . . >
   [ . . . ]
  </rdf:RDF>

Of course, such a service may wish to restrict itself to serving local
files only, in part for security.  For non-local files it could return a
normal 303 response:

  HTTP/1.1 303 See Other
  Location: http://iandavis.com/2010/303/toucan.rdf
  Content-Type: text/plain

  Redirecting to: http://iandavis.com/2010/303/toucan.rdf 


-- 
David Booth, Ph.D.
Cleveland Clinic (contractor)
http://dbooth.org/

Opinions expressed herein are those of the author and do not necessarily
reflect those of Cleveland Clinic.

Received on Monday, 8 November 2010 20:34:40 UTC