Log in

No account? Create an account
Stupid URLs - brad's life — LiveJournal [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Stupid URLs [Jan. 5th, 2004|01:12 am]
Brad Fitzpatrick
Whenever I see a stupid URL like:


I wonder: Are they actually using a huge VARCHAR to store that digest string as their primary key? And everywhere they need that primary key? What is that a digest of? The article text? A unique integer?

If anything, I hope they map that digest to an integer, and use the integer everywhere internally. But why use such an ugly URL, then? To prevent enumeration? Just add some random junk chars that are tied to the integer, then:


At least it'd be shorter.

Anybody familiar with any of the code for the different content management systems which use MD5 URLs?

(I tried to sleep and failed.)

[User Picture]From: prema
2004-01-05 09:43 am (UTC)
I previously thought it was related to encryption and never bothered much, but your question made me google.

http://www.truerwords.net/1740 - the threads below discuss this to some extent.

I think it's mostly to ensure the uniqueness of the digest, i don't think anyone would spend much time to clean it up and make the url look aesthetically pleasing or even comprehensible for users, simply because of the sheer volume message threads can generate. The cleaner url that maps to the long one would still have to be unique, and that's just extra effort. Although the var is called article, I suspect it's managed much like a message post. If that made any sense.

Um, Hi. I just started lurking in the background reading your LJ. :)
(Reply) (Thread)
(Deleted comment)
[User Picture]From: brad
2004-01-05 04:18 pm (UTC)
But I argue it's a shitty implementation, as well as a shitty interface.
(Reply) (Parent) (Thread)
[User Picture]From: supersat
2004-01-05 09:47 am (UTC)
At least it's marginally better than using GUIDs for everything (like GotDotNet uses for its blogging system). The URLs are horribly ugly: http://blogs.gotdotnet.com/raymondc/PermaLink.aspx/f4300961-3a9d-4c4d-977f-1d10e90b95f0
(Reply) (Thread)
[User Picture]From: taral
2004-01-05 10:34 am (UTC)
Looks like someone who wanted a key and didn't understand how to use sequences. :)
(Reply) (Thread)
From: zezu
2004-01-05 10:55 am (UTC)


This might be slightly off-topic, but tinyurl.com may be of interest. Feed it a huge url (hurl?), and it spits out a redirect page with a very short url.


I've used it once or twice.
(Reply) (Thread)
[User Picture]From: greg
2004-01-05 05:27 pm (UTC)

Re: tinyurl.com

This is not a dig at tinyurl.com but it's not quite as cool as I initially thought.

I initially thought that the URL you get out of tinyurl.com was some sort of hash of the original long URL. However, it appears to be just some database reference and not that I care so very much but it could certainly lead to privacy concerns.
(Reply) (Parent) (Thread)
[User Picture]From: mart
2004-01-05 01:49 pm (UTC)

I just wish they'd use a sensible URL for the article involving the article name, such as:


However, I guess for user-submitted articles they can't let users pick the URLs in a global namespace like that.

(Reply) (Thread)
[User Picture]From: j7xz49br3m93xrr
2004-01-05 02:56 pm (UTC)
Sometimes it's a mixture of session tracking and page reference into one string. Clever in a way, but produces sucky URLs. You run into it a lot on certain forums, although most just stick to keeping session and target separate.
(Reply) (Thread)
[User Picture]From: muerte
2004-01-05 04:03 pm (UTC)
What does "junk chars that are died to the integer" mean.

I've never heard the term died used like that.
(Reply) (Thread)
[User Picture]From: brad
2004-01-05 04:19 pm (UTC)
eh, "tied". it was late.
(Reply) (Parent) (Thread)