Re: mitigating cost of 303

On 01/04/2012 03:38 PM, Sandro Hawke wrote:
> I was thinking something more like json:
> 
>         [ { verb: "GET", from: "/r/(.*)", to: "/page/$1", code: 303 },
>           { verb: "GET", from: "(/data/.*/[^.])", to: "$1.rdf", code:
>         303 } ]
>         
> The second rule assumes everything under /data has a form with no suffix
> (no dots in the last segment) that redirects to the same name with .rdf
> appended.

Your example does not address the (quite common) case where the
redirection is content negociated -- e.g. dbpedia redirecting to from
resource/Lyon to page/Lyon if you want HTML, or data/Lyon if you want RDF.

I guess this could be adressed by something like

  [ { verb: "GET", from: "/r/(.*)", to: "/page/$1", code: 303 },
    { verb: "GET", from: "(/data/.*/[^.])", code: 303,
      accept: "application/rdf+xml", to: "$1.rdf" }
    { verb: "GET", from: "(/data/.*/[^.])", code: 303,
      accept: "text/html", to: "$1.html" }
  ]

but there is a delicate trade-off to find between simplicity and
usefulness...

  pa

Received on Wednesday, 4 January 2012 17:46:46 UTC