With the rise of short message systems like Twitter, there is a growth in URL shorteners (as each one's namespace gets full, others get shorter). Today bit.ly launched to big fanfare in the blogosphere.
I took a closer look. What I noticed is that the older generation of these - tinyurl.com and xrl.us use a 301 Moved Permanently redirect, whereas bit.ly and is.gd use a 302 Found redirect, which means 'don't cache the redirected URL, keep checking the original'.
In other words, these services are saying in their HTTP responses that they may change what the short URLs point to in future, putting browsers, indexers and caches on notice that this may happen.
I also noticed that bit.ly, like tinyurl.com, allows you to pick a custom label from their namespace, but if you do it returns two 302 redirects in sequence (once to a more cryptic bit.ly url, then to the external one you chose). I pointed bit.ly/k at this blog, so you can check it yourself with curl:$ curl --head http://bit.ly/k
HTTP/1.1 302 Found
Location: http://bit.ly/fwNKA
$ curl --head http://bit.ly/fwNKA
HTTP/1.1 302 Found
Location: http://epeus.blogspot.com
Apart from the extra delay this introduces, this is also telling your browser and web crawlers not to cache this, as they may change it in future. Compare tinyurl.com:$ curl --head http://tinyurl.com/kevinm
HTTP/1.1 301 Moved Permanently
Location: http://epeus.blogspot.com
Google's advice for webmasters is to use 301 for redirects, as this signals the preferred URL.
7 comments:
hey, there, k, i'm your neighbor, l. (not much there at the moment). it's been a while, hope you're doing well, gary.
That's not the only bit of the HTTP protocol they got wrong; bit.ly ignores any and all cache controls that page authors put on their pages:
http://q.queso.com/archives/002296
Sigh.
Okay, maybe not. I've just read my curl response and realised is.gd uses 302 Found as well.
I obviously need more coffee.
And somehow my other comment got lost. Disregard.
Hey Kevin, I think the service wants to see the traffic each time the user clicks on it (business reason), so they use a 302.
Post a Comment