In Fixing the URL params performance penalty, Barry Pollard sets up a very clear real-world conundrum. The content at these two URLs is probably the same:
https://www.example.com/https://www.example.com/?utm_source=email
The content at these two URLs is probably not:
https://www.example.com/products?productid=1234https://www.example.com/products?productid=5678
Who cares? Cache cares. Because content with different query params might be different, the various tech that deals with caching has to assume it will be different. But that sucks tho. And it’s not a new problem.
I’m not sure what the history or landscape of solutions is for this, but one from the Chrome gang that is rolling out from them is a new header: No-Vary-Search. The idea is that you get the control as the owner of the site to say how it works on your site.
No-Vary-Search: params, except=("q" "productid")Code language: JavaScript (javascript)
So with a header like the above, you’re saying “query params never matter on this site, they will not effect the content on the page, except for these two, those two do.” That seems awfully useful to me. Just don’t get it wrong.
Speaking of URLs, you know what site used to have has great URLs? Flickr, the photo sharing site. Why did that have to fade away, anyway? I think it was basically infinite cloud storage of camera rolls on mobile phones and Instagram. I do hope there is a resurgance of “a social place to share my best photos” that does well again, but I digress. Flickr’s URLs were great, and Marcin Wichary sings their praises in Unsung heroes: Flickr’s URLs scheme.
flickr.com/photos/mwichary/favorites
flickr.com/photos/mwichary/sets
flickr.com/photos/mwichary/sets/72177720330077904
flickr.com/photos/mwichary/54896695834
flickr.com/photos/mwichary/54896695834/in/set-72177720330077904
This was incredible and a breath of fresh air. No redundant
www.in front or awkward.phpat the end. No parameters with their unpleasant?&=syntax. No%signs partying with hex codes. When you shared these URLs with others, you didn’t have to retouch or delete anything. When Chrome’s address bar started autocompleting them, you knew exactly where you were going.
If you have found yourself on Flickr recently, it might be because NASA is on Flickr and the Artemis II mission posts their official photos there. There’s some really great photos there, still rocking those equally great URLs.
There are new ideas in clever URLs out there as well. You know how there are some unofficial but obvious conventions for certain pages? I mean like the contact page is probably /contact and the page for hiring is probably /hiring. What is the URL for changing your password? There is no real convention for that. It might exist on a dedicated URL or it might be part of a settings or account page.
If there was a strong convention (and here’s Eiji Kitamura suggesting just that) users, and perhaps more importantly password managers, would know how to get you there. The URL?
/.well-known/change-password
I don’t know much about that special directory, I know it’s just used for things like verifying DNS setups and payment processors and stuff. Seems like a perfectly good usage for me. And it doesn’t mean that URL is where you actually change your password, it just redirects to wherever makes sense in your site.
Too weird to take off? Here’s some sites already doing it:
Cool.