8 ms·
An example of a not-so-great URL design: Amazon product links have an optional slug before everything else like `{slug}/dp/{id}`. So you end up copying a gigant
by wizerno 2y ago
An example of a not-so-great URL design: Amazon product links have an optional slug before everything else like `{slug}/dp/{id}`. So you end up copying a gigantic URL everytime you wish to share a product unless you use the share product button to get the shortened link.
- layer8 2y agoIt’s not that difficult to shorten it to the minimal “/dp/:id”. I always take care to do that when sharing an Amazon link.
- robin_reala 2y agoI just delete everything after the product ID manually. There are probably easier methods.
- xyzzy_plugh 2y agoI think this is actually a really great design in that the name of the product can always be in the URL. The "slug" is completely ignored and just there for SEO/humans. If you send a link I instantly know what it's for -- that's pretty useful! I also like that the "id" which is an ASIN (Amazon Standard Identification Number) which is a superset of all ISBNs. This means you can just enter any book ISBN directly into the browser and end up on the right page (at least historically) instead of having to search for it.
- pests 2y agoThis got a major retailor (Walmart maybe?) into issues awhile back as they were pulling the product title (only) from this param so people were having a heyday "renaming" official products on the official site.
- wizerno 2y agoWhile the slug helps someone know what they're opening before reading it, most apps have link previews which give you just enough information you need.
- namrog84 2y agoI dont know if I'm in the minority but I really dislike link previews the vast majority of the time. They take up too much space and offer to little value. In discord I often x out of the preview and I know lots of others who do too. Maybe on some sites it's fine but I feel like link previews need more modularity on size or something. Perbaps even configurable both host and client
- xyzzy_plugh 2y agoYou're not in the minority. The information density of the preview has to match, if not exceed, that of the context in which it is provided. Most of the times it's a placeholder image with less text than the URL itself.
- fsckboy 2y ago>>Amazon product links have an optional slug BEFORE everything else >I think this is actually a really great design in that the name of the product can always be in the URL he said "before". you could accomplish your goal putting the slug "after". he's making the point that having a place after which you can harmlessly delete the rest of the url is better than having embedded NOPs surrounded by identifying information (not that the average user will ever edit any url, but there is still merit in what he said that you missed, and he's not disagreeing with you)
- chamomeal 2y agoLol this is almost the exact same thing as the very first example of good URI design in the article
- wizerno 2y agoIf you're referring to the StackOverflow example from the article, it's different because they follow `/questions/:id/:slug`. Keeping slug at the end makes it a lot easier to delete while keeping it readable.
- ryukoposting 2y agoAt least that stuff is actually informative to a human. A lot of Amazon's URL bloat is the analytics crap they shove into query string. I started using ClearURLs specifically because of Amazon.
- crazygringo 2y agoIt is a curious decision why they chose to put the ID before the slug. Stack Overflow, in contrast, puts the ID first, followed by an often very long slug. Which seems to be the more common pattern generally, as far as I can tell. I do wonder what their rationale was/is.
- JohnFen 2y ago> So you end up copying a gigantic URL everytime you wish to share a product Yeah, when I used Amazon I found this incredibly annoying. When I wanted to share a link, I'd have to spend a few minutes figuring out how much of that stuff I could remove and testing the resulting URL before sharing it. A relatively minor irritation, but an irritation nonetheless.
- fsckboy 2y agohaving, like you, studied amazon urls, I just automatically delete everything?inclusive after the "?", then I edit the slug to make it contain a message personalized for my recipient