Live data from Hacker News

Broken Links

tbray.org

41–50 of 95 posts

Re: Broken Links

#41
post #30

Earlier quoted context omitted.

You don't need the hashbang for that. You never did. Hashbang only tells google "munge around this shit to get an actual page".

I'm curious what the other solutions are then. The only one I can think of is the History.pushState, and that's only supported in newer browsers. Let's say I'm writing a web based word processor, and a user clicks on a document. I want the URL to be a reference to that specific document. The only way to change the URL to be specific without requiring a whole-page refresh is to use the hashbang syntax.

well it looks like they are emitting crap like this

About

without the hashbang shit, that's a nice normal link that any normal http client can work with. you can still layer on ajax to bind to that link, and use the fragment for the benefit of browser state and user interaction should you think that is a wise thing.

Re: Broken Links

#42

Earlier quoted context omitted.

It's really great that in a few years, browsers will support a new AJAX technology that solves this problem that we wouldn't even have with sane, traditional URL schemes.

Maybe you're trying to be snarky, but I'll choose to take your comment seriously. The AJAX approach to Web apps does provide a genuine user interface benefit. A full page load is very disruptive to application flow, and being able to have new data appear without incurring that penalty is great. Most of the time you only need to load a little bit of data anyway, and it's wasteful to reload all the markup that wraps it…

"Most of the time you only need to load a little bit of data anyway" - that's highly questionable as a general statement. In a rich UI like GMail, yes. But in examples like the new Lifehacker, you load a whole story, yet its locator is behind the hashbang.

Not every website is a web app. Just show one article or item or whatever the site is about under one URI.

Re: Broken Links

#43
post #24

With pushState not widely implemented, you have three choices: 1) don't use AJAX in response to actions that alter the page content in a significant way. This of course forces page reloads and prevents the cool emerging pattern that is to not serve dynamic HTML but just have a REST API and do the rendering client side. 2) you do the ajaxy stuff but you don't touch the URL. This leads to a nonworking back button and p…

I've proposed sort of possible solution here, in a related discussion: http://news.ycombinator.com/item?id=2197064

Re: Broken Links

#44

Earlier quoted context omitted.

Maybe you're trying to be snarky, but I'll choose to take your comment seriously. The AJAX approach to Web apps does provide a genuine user interface benefit. A full page load is very disruptive to application flow, and being able to have new data appear without incurring that penalty is great. Most of the time you only need to load a little bit of data anyway, and it's wasteful to reload all the markup that wraps it…

"Most of the time you only need to load a little bit of data anyway" - that's highly questionable as a general statement. In a rich UI like GMail, yes. But in examples like the new Lifehacker, you load a whole story, yet its locator is behind the hashbang. Not every website is a web app. Just show one article or item or whatever the site is about under one URI.

That might be the case for LifeHacker (don't know; don't use it). But the example in Tim Bray's post is Twitter, which definitely needs to load a lot less data than it's full interface markup on most navigations.

Re: Broken Links

#45

Facebook had an outage some time back (I think this one - http://www.facebook.com/note.php?note_id=431441338919 ), and when everything got back to normal, the hash-banged URLs were gone. Was it related?

They are still there in IE, so I guess they have started using push state where available.

Re: Broken Links

#46

Earlier quoted context omitted.

Maybe you're trying to be snarky, but I'll choose to take your comment seriously. The AJAX approach to Web apps does provide a genuine user interface benefit. A full page load is very disruptive to application flow, and being able to have new data appear without incurring that penalty is great. Most of the time you only need to load a little bit of data anyway, and it's wasteful to reload all the markup that wraps it…

"Most of the time you only need to load a little bit of data anyway" - that's highly questionable as a general statement. In a rich UI like GMail, yes. But in examples like the new Lifehacker, you load a whole story, yet its locator is behind the hashbang. Not every website is a web app. Just show one article or item or whatever the site is about under one URI.

Lifehacker kind of looks nicer only loading reloading the story and not the whole page. I gives things an application feel rather than a collection of pages and saves a heap of extra processing, why run the code again to generate a header and footer and side bars constantly when the version the user is seeing is perfectly up to date.

Re: Broken Links

#47
Ran into another interesting shortcoming of hash-bang URLs last night looking through my referrer log. Loads of referring URLs of http://gawker.com/ and http://kotaku.com/ to my blogpost. But no mention at all of my blog-post or a link to it on the homepage.

First I thought they were referrer log spamming, then it dawned on me that fragment identifiers get stripped out of HTTP referers, so making hash-bangs useless as a means of joining up distributed conversations on the web.

Somewhere on those two Gawker media sites there's a conversation going on about the use of hash-bangs. But nobody outside knows about it. It's a big black hole.

Re: Broken Links

#48
Isn't the underlying problem that web applications are often displaying combinations of content that doesn't have a natural URL?

Take New Twitter, for example. If I click on a tweet in my stream, it shows related tweets. If a drill down a few of those, at some point it becomes impossible to represent the address of the current state in a sane manner.

I think URLs are particular to the web (desktop apps don't have them) because the web is traditionally about content. Web applications are increasingly breaking that. Perhaps web applications and URLs don't go together all that well.

Don't get me wrong--I love URLs, and it's crazy for content sites like Lifehacker to break them for so little benefit. But maybe the reason for this hashbang trend is that URLs aren't expressive enough for some of these sites.

Re: Broken Links

#49
Despite all the FUD around hashbangs, the genuine problem I see with them is that they optimise for internal page loads, not the entry into a website. For example with hashbangs, requests to twitter when logged in go like;

1) HTTP GET http://twitter.com/some_account [~500ms for me]

2) 302 redirect -> HTTP GET http://twitter.com/ [~600ms for me]

3) HTML tells browser to download some JS -> HTTP GET bundle.js [~500ms for me] (concurrently here we start getting CSS)

4) JS reads hashbang & request actual data -> HTTP GET data.json [~500ms for me]

... only after about 2 seconds can we start(!) rendering data. Now there's about another 2 seconds for all json data & CSS calls to complete. It takes upwards of 4 seconds for a twitter page to render for me (the Load event lies as it fires well before actual data shows. Try it yourself with your favourite browser inspector).

When not using hashbangs, a single HTTP request can get all the data for the page and start rendering it. One blocking CSS call (possibly cached) is all that's needed for styling.

Hence when I see an external link with a hashbang it frustrates me (barely perceptively) because I know that when I load the page it's going to take a longer than a normal HTTP request. Significantly longer. While subsequent page loads are faster, it's not these you want to optimise for if you care about bounce rates. This issue affects every new link you click into a website, so it affects an even larger number of requests than normal bounces.

Hashbangs are a good solution to an important problem, but I don't see them as a tool to build entire websites upon. Fortunately I see the performance issue as one which will result in people voting with their browsers and choosing sites which only use hashbangs when they genuinely improve the user experience - especially since they're easily visible in the url.

Re: Broken Links

#50
post #30

Earlier quoted context omitted.

You don't need the hashbang for that. You never did. Hashbang only tells google "munge around this shit to get an actual page".

I'm curious what the other solutions are then. The only one I can think of is the History.pushState, and that's only supported in newer browsers. Let's say I'm writing a web based word processor, and a user clicks on a document. I want the URL to be a reference to that specific document. The only way to change the URL to be specific without requiring a whole-page refresh is to use the hashbang syntax.

> I'm curious what the other solutions are then.

The hash without the bang. It's only been done for about 10 years. You can put whatever you want after the hash. It's up to your application to decide the meaning of it.

For an example, see the OSX SDK documentations: http://developer.apple.com/library/mac/#documentation/Cocoa/...

Post reply on HN