You are reading a single comment by @bq and its replies. Click here to read the full conversation.
  • URL best practice is a changeable thing. Here's what I currently recommend to those with the luxury of choosing their own URL pattern:

    As a general rule URLs should be usable as an API - that's as human-readable/memorable as they need to be. Whether you do that by numbers (as long as they are short enough) or words is up to you. As you say, once you go multi-lingual, words can be problematic.

    https://lfgss.microcosm.app/conversations/1/?offset=25 is less memorable due to the query string. If you can use routing on the back-end and the history api on the front end to allow something like
    https://lfgss.microcosm.app/conversations/1/25 then you a) hide your back-end technology a bit more, and b) make more memorable URIs.

    With identifiers, it helps to make them alphanumeric, and if possible to split them up into groups of 4 or less, (with slashes or dots). Your routing should process the same identifier with and without the dividing characters, and be case insensitive, so that people can speak URLs and be understood. (that's also why dots or slashes are better than hyphens or underscores)

    Amazon do all the things Velocio described - for example
    "http://www.amazon.co.uk/gp/product/B0093XXFZM/" will take you to the product but they add all sorts of tracking and metrics stuff as a query string, so if I click it from the homepage I get
    the same link but with a whole load of crap after it as a query string. Clearly their routing only goes so far
    And if you search through their page source code you find
    which must only exist for Google, because I couldn't find a way of getting that link by sharing or anything, It doesn't work without the alphanumeric ID.

    (now I've done that Amazon are convinced I want a load of James Bond DVDs)

    With pagination, incidentally, copy search engines and go with start offset and number of items to fetch. This is easier to code and doesn't back you into a corner with defining 'pages' of certain sizes, and you can also use it internally for infinite scrolling and JSON calls.

About

Avatar for bq @bq started