The URL shortener situation is out of control
hanselman.com
hanselman.com
I recently found this happening with Twitter's Android app. The user sees a link to player.fm and thinks it will open the native Player FM app if they have it installed, since it's registered to handle that URL pattern. But instead, the OS offers web browsers and Twitter as ways to open the link, because it's not really a player.fm link as presented to the user, but a t.co link. If the user then chooses a browser, the browser immediately redirects to the correct URL, which then pulls up the intents menu again.
7 redirects could potentially be 7 popup menus for the user to navigate through.
The OS could pre-emptively follow redirects, but that would of course introduce considerable latency since normally the menu is presented without any call being made at all. Maybe the best solution for OSs is to present the menu immediately but still make the call in the background, so the menu could be updated if a redirect happens.
"I don't see any work happening in HTTP 2.0 to change it."
Probably the best HTML standard for dealing with it is the "ping" attribute which allows a way for servers to be notified of a click without actually redirecting. However, that's HTML and not HTTP, and these days, apps are more popular HTTP clients than browsers, and apps don't manually bother to implement things like that.
So there are probably things that could be done with the standard. Perhaps using some distributed lookup table to ensure at most 1 redirect (by caching the redirect sequence and returning it with the first request). That does ignore any personalisation that goes on, but generally these should be permanent redirects without personalisation anyway.
You don't even have to go that far. Just click on a youtube link. First it'll ask if you want the www.youtube.com url to play in a browser or the app (which sucks), then it'll redirect to m.youtube.com and ask you again.
Only reason I haven't set it as my permanent choice is because I still hold out some shred of hope that the youtube app will be able to play an entire video without stopping for 2 seconds every 3 some day in the future.
It usually works, and when it does it's nice to fix the idiotic Twitter-android-app behavior.
Possibly even deliberately - enabling that by default automated way in commonly used products, so that this tracking becomes ineffective and useless, and there's no more motivation to insert these artifical layers of redirection.
(Or perhaps only allowed a cookie if the redirect was served by the same domain as the target domain.)
I personally would not mind but I'm pretty sure that a lot of monied interests would not like to see this happen.
People want analytics information, and the only way we can do this now is by adding things like this. (Not strictly true, but ease of deployment, etc).
Unless you shut down the only way to do something, the people who want this service will work around whatever restrictions have been put in place, and the solution we get will probably be even uglier.
The real way to get rid of this is to provide a mechanism that addresses everyone's desires.
it's a social problem, not a technological one imho.
Click count statistics, time-clicked, and geo-information can all be gotten without any cookies. Some sites use url shorteners just to see clickthrough statistics, which can always be determined with no cookies etc.
Yeah, there are things that might have some problems with this, but they're things that are probably somewhat abusive to the 301 status code to begin with.
I agree that this is an unfortunate pattern, but what exactly could the HTTP spec do to change it? The only thing I can think of is limiting the number of chained redirects, although I don't see browsers implementing that if longer chains are even remotely common.
if my sketchy memory serves me, it was based around using a currency and updatable links. Along with that, the idea was that you could also share segments of movies and music with the hyperlink system.
I'm pretty sure it died a pitiful death due to it being completely secret until after HTTP got ingrained.
1.) The browser could pro-actively lengthening the URL and the same way the server can respond 302/301 now the browser could cache this. 2.) The server could hand-back the final long URL with out needing to redirect the URL multiple times 3.) We could create services that can be integrated into the server software that integrate 3rd parties. 4.) Each domain could create their own shortened URL domains and mask it in a better way.
3)I am assuming the services you want to integrate into the server software will resolve the shortened URL into a long one or vice versa but in case there are multiple redirects the services would still face the latency of redirects.
The server at t.co could send a request (HEAD works) to slate.me, and follow up any redirects it gets to resolve the final URL. (This could be done just by following until no more redirects, or only sending requests to known URL shorteners -- there's advantages and disadvantages to both) -- and you don't need any new HTTP verbs to do it.
1.) The browser can offer the ability to (right click) and shorten a URL or lengthen it. A HTTP standard would provide this mechanism.
3.) The would not require multiple redirects because everyone should ask the domain. If the URL is already shortened then there is not need to shorten again. - service like bit.ly, goo.gl can provides services to: 1.) Actually shorten, statistics...
The most obvious one is Twitter, always using it's own service regardless.
I'm not sure if this can be resolved until users are educated sufficiently on the long-term adverse effects of link shortening services (link rot, privacy concerns, slow/broken redirects, etc).
For change to happen the demand for direct links (generated explicitly by things like this blog posts, or implicitly by higher bounce rates due to long loading times) will need to be enough to outweigh the benefits to organizations that are building them.
Edit:
Even if there is evidence that shows this, why should _I_ be the one to give up my link shortener service when it will have no significant improvement to the overall problem which involves tens or hundreds of these services?
It wouldn't solve it completely, but it'd kill the 7 redirects thing.
I don't think this can be solved technologically - HTTP redirects are not difficult to detect but a lot of these shorteners (and becoming increasingly more common) use Javascript and/or meta tags to accomplish redirection. The solution is better educated users that don't create chains of shortened URLs.
I'm not a networking expert, but it seems viable enough to me. Shoot out a GET request, wrap the final address with your shortener. Cut out the middlemen.
It's an idea. It might fail at scale. And might not be feasible.
Directly serving the content while possible is not what my client wants. They want to go from their short URL to the longer full domain one.
We do this to catch certain spam urls.
I never liked this SEO "feature", however. My thinking is why should search engines really care about the URL WRT content? Seems like a shortcoming of the engines, as well as a potential technique for gaming the search engines. In fact, it seems that if search engines could determine that URLs were being used to game them, then they wouldn't need sites to bother with this behavior in the first place. OTOH, if search engines cannot tell they are being gamed with URLs, then it's also completely useless.
What am I missing?
These are all good reasons, but are there any real users who are actually being affected by these issues? If it is just a theoretical concern, then I don't think it is reasonable to call the situation "officially out of control".
There's also this service that expands shortened urls: http://longurl.org/
Here's the script: https://gist.github.com/akenn/7ca7e99a51c3a4abc049
Speaking of, what software did this guy use? Is there a bash script that's better than what I wrote?
https://gist.github.com/bertjwregeer/12ae691e5c285f334a36
No need to use Node.
Like hotlinking images from someone else. They might block you, or they might just serve your goatse.jpg instead.
> Because you are being served content from other people's servers. If one of those servers fails, the whole site you are trying to load fails.
Say what?
Many of those things are just tracking pixels. There is no way to serve them from the site host, that's the whole point. And if they fail to load, nbd.
And sure, if some substantial piece of JS or CSS doesn't load, that could cause problems on the page, but in most cases it wouldn't cause total failure of the site loading.
Public CDNs for shared assets makes a lot of sense.
These things are nothing like hotlinking somebodies image.
Otherwise "interceptors/tracers" seems a better name.
I think URL un-shortening should be done in the browser, on URLs that were shortened according to a standard hashing method, so your browser can tell you where the URL will go.
Shortening sevices are ridiculous and dangerous.
Hashing, by definition, is non-reversible. So if you use a hashing method as your shortening system, you'll have a fingerprint from which the actual destination is unrecoverable.
> Shortening sevices are ridiculous and dangerous.
Right, and there is no reason to use them in any situation where the target is a browser, anyway. It makes sense to use a shortening service if you are going to be sending a URL in an SMS message, but if its going to a browser, there's no reason not to use the full URL. So, really, a server based system that will send message both as SMS and to regular browser users should support a shortener and use it only when sending SMS.
I think if you think about this for a few seconds, you'd find out that if you were able to create such a solution, you've have destroyed some information theory laws.