Hacker News new | past | comments | ask | show | jobs | submit login

An indirectly related fixation that bugs me every time I see a Facebook link is this: why are notes, events, etc. appended with a string of digits?

Shouldn't the URL here be simply: https://www.facebook.com/notes/kent-beck/rip-tdd/ rather than https://www.facebook.com/notes/kent-beck/rip-tdd/75084019494...?

Does every element that exists on facebook.com get assigned a unique string like the one above?




Basically, the "/kent-beck/rip-tdd" portion is for humans (and/or SEO), so that we can look at the URL and have some idea of what it is, and the "750840194948847" is for their server to figure out what to actually show. You can change the for-humans part to whatever you want and still see the same note: https://www.facebook.com/notes/foo/bar/750840194948847

The advantage of only looking at the number is that if Kent Beck's name changes or the title of the note changes, they can just start linking to a new URL with a changed human-part (but the same numeric identifier) and the old URL will still work. The "correct" way to do it would be to track and validate every version of the human-part for every URL, redirect old versions to the newest version, and 404 made-up ones. But in a way that would be slightly inconveniencing human users following outdated links by making their browsers follow a redirect when really only search engine spiders care whether there's a single canonical URL per page, so if Facebook has given it any thought, they probably decided just to not bother.

And at their scale, keeping track of one or more string URL versions for each page (that is, each piece of URL-addressable content that makes sense to have some kind of title slug included) would be non-trivial. Billions and billions of URLs to track, dubious benefit.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: