URL Shortening Hinting

April 3rd, 2009

Chmurka & Bu?eczka (+ MESSAGE TO THE WORLD)

We’ve been playing with coding up a URL shortener at Flickr this week. A URL shortener that only shortens Flickr URLs. (and right now only shortens URLs to photo pages)

Amazingly enough, this stodgiest of all conversations is a hot topic this week, with joshua’s url shorteners considered harmful post acting as something of a catalyst. Though the slick looking working on DiggBar has to be on folks mind.

Meanwhile I was curious if there a proposed rel=”alternate” syntax floating around for sites that run their own URL shortener?. I thought Dave posted one as part of his call for sites to run their owner shorteners, but I can’t find any evidence that this is correct memory.

Kevin Marks suggested rel=”canonical” and when I said that was the opposite of what I wanted replied rev=”canonical” is by definition the opposite of rel=”canonical”, but in practice people don’t grok rev. I had never heard of “link rev”, but lose the idea of marking up pages with their canonical opposites. But is that correct?

Les Orchard suggested the probably more practical rel=”shorter-alternative”, with Jon Williams refining to “rel=”shorter alternative” because IIRC rel values are like CSS classes“.

All of this implicitly based on the Mark’s work on RSS auto-discovery.

I realize this probably reads like a blow by blow description of watching paint dry.

But I’d like to pretend we’ve got some momentum here, maybe we could solve all the world’s problems my dinner time. (or at least auto-discovering url shortening problems)

update 2009/4/6: And I’ve published my rev=”canonical” URL shortening service

Photo by chmurka, just because.

25 Responses to “URL Shortening Hinting”

  1. Tim says:

    At least one of us is enjoying watching the paint dry, although I don’t have any particularly insightful comments other than cheering y’all on.

  2. Jeremy Keith says:

    Just to clarify what Kevin was talking about with the rev attribute:

    While rel is used to define the relationship of the linked document to the current document, rev — which stands for reverse relationship — is used to define the relationship of the current document to the linked document.

    Let’s say I have a complex checkout page. I could link to a help page with rel=”help” (the relationship of the linked resource is that it is “help” for the current page). On that help page, I could link back to the checkout page with rev=”help” (the relationship of this page is that it is “help” for the linked resource).

    So Kevin is right to say that a canonical document could potentially point to a shortened url with rev=”canonical”: the relationship of this page is that it is the canonical version of the value in the href.

    But Kevin is also right to say that there isn’t much real-world understanding of the rev attribute and so it’s probably going to be removed in HTML5. I understand the decision but it’s a bit of a shame. I always liked the idea of the vote-links microformat (which uses rev) but in the Darwinian world of microformats, it just wasn’t strong enough to make it: http://microformats.org/wiki/vote-links

    Also: I hereby out myself as a card-carrying watcher of paint drying.

  3. Kellan says:

    I’m sad that rev is deprecated in HTML5, Shawn also mentioned that. That would probably make it bad form to launch with it on Flickr. Still tempted…

    What did y’all think of the “alternative shorter” rel?

  4. Scott Lawton says:

    I think you mean “alternate” not “alternative”???

    Just at a glance, “rev” looks correct but too obscure. “alternate shorter” seems fine, though would be interesting to see how many ad hoc auto-discovery routines picked it up without checking for type=rss+xml (etc.). Arguably just “alternate” and type=html is sufficient, though perhaps easier for both HTML writers and ad hoc parsers to get wrong.

    Personally I would rather see just rel=”shorter” to avoid confusion with the feed usage of rel=”alternate” … but that’s a pragmatic solution that will surely draw criticism. (And the critics may well be right; I haven’t thought the issue through in any detail.)

  5. Shawn Medero says:

    RE: HTML 5 & @rev… it might just mean that no one made a decent case for keeping @rev. I thought the footnote references use-case (PHP Markdown Extra does this) was decent but… I am not sure how many deployments of Markdown Extra there are…

    One of interesting point is that I think all of the data collected on use of @rev came from either the 2005 Google study or Philip Talyor’s dmoz scraping. So it could be interesting to collect more data with a more diverse set of URLs.

    One other point is that… if Flickr deployed @rev on the rather large number of URLs it has, I think someone would be willing to take a longer look at it. That’s not to suggest anytime a large site does something wacky with HTML (err, Facebook) that the HTML community should suddenly specify it, but it certainly doesn’t hurt to have a reference point for a large scale implementation.

  6. l.m.orchard says:

    Leaving @rev out of HTML 5 is probably just thanks to no one having found a compelling use.

    I’d prefer to see something semantically clear and actually previously spec’d like rev=”canonical” – rather than something less clear like rel=”alternate shorter” just because it happens to be not deprecated by someone somewhere.

    Lots of obscure and not-so-well understood parts of HTTP and HTML have been eventually put to good use, so why not @rev now?

  7. Eric says:

    Hey, read your post here via the comment you made on Schachter’s blog & I have a (related!) question for you. Are bit.ly & other non-Flickr shorteners currently disabled in comments on Flickr? Because it seems like it’s breaking stuff in a weird way when I try to use a bit.ly URL there (both inside & out of A tags). Anyway, just curious if this is intentional or unrelated (i.e. it’s been like this for awhile & I just never noticed =) or what. Thanks!

  8. Hi,

    Good idea! I wrote a similar solution up the other day as well:

    http://sites.google.com/a/snaplog.com/wiki/short_url
    

    cheers,

    r.S.

  9. Mike Malone says:

    Wouldn’t rel=”alternate shorter” imply that rel=”shorter” has some meaning? Would things like rel=”preview shorter” then become legal?

    I like the rev approach. If people find a legit use for it I bet they’d de-deprecate it in HTML5.

  10. A link element with a rev attribute value of “canonical”, type of “text/html” and a non-empty href attribute seems to be the best solution for the problem.

    If you use link element with rel=alternate and type=text/html then the media attribute (media=shortener) may be your best extrapolation of intent. Media is a comma-separated list, meaning you could declare a value such as “twitter,email,shortener” if desired.

    Declaring a link element of rel=alternate with type=text/html and a non-empty href attribute on a text/html document is definitely confusing for the renderer. What is this alternate that appears exactly equal (in type, lang, and charset) to the currently viewed document? Language selection is the most common user-facing interface for such head data.

    See link types from the HTML 4 spec for more details: http://www.w3.org/TR/html401/types.html#type-links

  11. Isofarro says:

    Be careful about how you use rev=”canonical”. If any page can claim to be the canonical version of any other page, it opens the way for authority pages to be hijacked by SEO-types – claiming their ad-infested pages are the canonical version of your blog.

    Although rev=”canonical” feels right, I suggest insisting that the URL it points to MUST have a rel=”canonical” back to the URL claiming to be the canonical version, otherwise do not trust the resource making the rev=”canonical” claim. Yes, two-way linking – it’s very Xanadu-like, but I feel its absolutely necessary to protect the genuine canonical version of content. And this should fit neatly into the purpose of short-URL linking, the non-canonical version in these cases isn’t expected to be canonical, merely a pointer to the canonical version.

    Mike.

  12. Would be nice if this service were #-aware.

    http://singpolyma.net/2009/03/delegating-to-multiple-openids/#comments

    is giving back:

    http://singpolyma.net/p/431

    Which does not go to #comments at all.

  13. […] with one comment Re-posting my post URL Shortening Hinting: […]

  14. Kellan says:

    Stephen thanks for you patch. It’s applied and live.

  15. Leah Culver says:

    Whatever you folks decide, I’d be happy to stick on Baconfile for the tinyb.cn custom tiny urls. Thanks!

  16. […] concerned about the fitness of the web have been abuzz over the concept of shortening URLs via the rev=”canonical” concept. The idea behind it is that resources on the web provide a hint about their everlasting short URL […]

  17. […] been busy trying to find a way out of URL shortner services. Kellan Elliott-McCrea has worked out a solution which lets the publisher gain control over the shortening. I think using rev to indicate the […]

  18. Andy Mabbett says:

    At the risk of repeating others; and things I have recently said elsewhere:

    rel=”shortcut” is more precise than rel=”short[er]”.

    Evidence would seem to suggest that paired, reciprocal rel values (e.g canonical/ shortcut) are less prone to human error than rel/ rev pairs – that’s apparently why “rev” was removed from HTML (not, as suggested, because of lack of use-cases).

    The problem of hijacking though falsely-claimed canonicity would be negated if cross-domain rel=”shortcut” (or whatever) + rel=”canonical” were only allowed where they are reciprocal; otherwise ignored. Shorteners should thus use latter, regardless of Google et al ignoring it for search aggregation.

    There would seem to be no need to include “alternate” in rel=”shortcut” links, indeed its use may be bogus.

    Shorteners which don’t handle “#” fragments are, in my view, broken and to be avoided.

    No apologies for watching paint dry; someone has to take care of this stuff, or everything will end up in silos, or broken, or both.

  19. […] revcanonical.appspot.com service offering discovery of onsite short URLs and providing an API for the same, from one of the originators of the idea, Kellan […]

  20. Erik Vold says:

    Great post Kellan I really enjoyed it!

    I am showing my support for rev=canonical over rel=short* and reasoning here: http://erikvold.com/blog/index.cfm/2009/4/21/revcanonicalgood

  21. ChL says:

    Is this “flic.kr” an official feature from Flickr, or someone registered this domain and is doing the redirects?

  22. Kellan says:

    It’s official.

  23. […] always liked the rev=”canonical” idea – it was proposed by pretty smart people and happy-making sites like Flickr and Dopplr implemented it pretty fast. So there was basically no […]