DISQUS

Officially Lucky: X-Rev-Canonical on Ars Technica

  • samj · 8 months ago
    Surely this is premature... there are much better alternatives to rev=canonical, not forgetting that rev has been rightly dropped from HTML 5.

    See rev=canonical considered harmful (complete with sensible solution)

    Sam
  • Clint Ecker · 8 months ago
    I personally do not use rev=canonical on Ars. I use rel="alternate short_url". We do not serve up the page under the short URL, but 301 redirect to the full URL.

    This post is not about that however. Rather, an HTTP header for clients to pull with a HEAD request.
  • samj · 8 months ago
    "The value "alternate" signifies that the IRI in the value of the href attribute identifies an alternate version of the resource described by the containing element."

    Furthermore:

    "[The rel] attribute describes the relationship from the current document to the anchor specified by the href attribute. The value of this attribute is a space-separated list of link types."

    So what you're saying is that the "alternate" and "short_url" link happens to be the same, while specifying that link. Clearly this is not what you're intending to say so you should first of all drop "alternate" - it's an alternative link to (approximately) the same content, not a link to alternative content (e.g. a PDF or text version). I'm not sure what kinds of breakage this will cause, but it's quite possible that it could interfere with search, newsreaders, etc.

    Then there's the whole debate about whether we should be using short_url given the confusion over underscore vs dash vs space, and then uri vs url. The best solution we've managed to come up with so far is "shortlink" which is both obvious and impossible to get wrong.

    Sam
  • Chris Shiflett · 8 months ago
    Hi Clint,

    I've updated the post to recommend Link, an existing header. See post for syntax. I think X-Rev-Canonical is easier to implement and parse, but I'm not trying to reinvent the wheel when it's unnecessary.

    Chris
  • Clint Ecker · 8 months ago
    Chris, I updated our code today. Should propagate through eventually.
  • samj · 8 months ago
    I see you're still serving up X-Rev-Canonical... I'm guessing we'll be seeing Link: headers before long...

    Sam
  • Clint Ecker · 8 months ago
    See my comment above. Some posts will still be using X-Rev-Canonical until they are rebuilt (we publish static PHP files for each article which are rsyncd to web frontends).