Its About The Hashbangs
danwebb.net
danwebb.net
I've heard a lot of FUDD surrounding hash-bangs, but no real convincing arguments why they're so evil. The argument will be moot once the majority of the internet community upgrades to modern browsers, which is not too far off.
I there was a bug tracking this for IE9 but it got closed. Not sure if there's one for IE10.
While IE's market share is decreasing, I believe it will be a long time before > 90% of users are not on IE 6-9.
http://arstechnica.com/web/news/2011/05/web-browser-market-s...
Hashbangs damage the Web.
(Is the present essay only concerned about the strict subset of navigation state encoded in fragments that seeks to be indexed by spiders? Or is it concerned about all such usage and is abusing the term "hashbang"?)
What's worse, fixing this flaw necessitates breaking all of the application's URLs.
When pushState is used properly, a single-page app essentially becomes a transparent client-side proxy/cache, which maps much better onto REST.
An application composed of a single representation that implements the entire app with code-on-demand is not exploiting the REST architecture very much.
Actually, even if the application is properly broken up into URIs, it's still not entirely RESTful because the "engine of application state" has become Javascript + secret protocol rather than hypermedia.
In what sense is using a hash as part of the address a hashbang?
Hashbang refrers to #!, #!, and only #!.
http://code.google.com/web/ajaxcrawling/docs/specification.h...
Nick Denton: "Dip in uniques largely because of drop in Google refers. Pageviews (which are driven more by core audience) less affected." -- http://twitter.com/nicknotned/status/61152134929981440
Nick Denton: "Google does not fully support "hashbang" URLs. So we're eliminating them rather than waiting for Mountain View." -- http://twitter.com/nicknotned/status/61465859079671808
Nick Denton: "Yeah, I'd advise against hashbang urls. Will kill search traffic -- even if you abide by Google protocol." -- http://twitter.com/nicknotned/status/62595141927583745
So here's a high-profile failure of hashbangs when it comes to being indexed by Google. Which means if it's search indexability you want, hashbangs isn't it. The Google spec just isn't mature enough, or well supported by Google search itself.
Push state is really good because it lets the server know what's going on, but it did not work in Firefox when I last checked.
I also find the best thing to do is use a hybrid approach (pushState where available, hashbang as a fallback.) If anyone else is interested in implementing this, there are some good frameworks[1][2] to give functionality similar to pushState via the fragment identifier.
Note that these constantly poll the hash in browsers that don't support the onhashchange event. It's a good idea to turn down the polling frequency to half a second or so, because I've found it can cause performance problems in IE.
One disadvantage is that the Referrer header does not include the fragment identifier. But that's a problem with the Referrer header and not necessarily the fragment identifier.
The fragment identifier has been a part of the web for years, for the purpose of describing the user's state on the client. It's just that we interpreted this as just meaning "bookmarks" and didn't use it for anything more than that. We've only recently started to understand the fragment identifier and use it more fully.
The only javscript hashbang I know is:
#!/usr/bin/env node
Look at http://tumbledry.org/2011/05/12/screw_hashbangs_building for how this would work, it was on HN yesterday. Visit just http://tumbledry.org to see how this can work.
I wonder if there's some JS library that transparently "fixes" issues like this for single-page sites with graceful degradation. Form handling, link click events, redirects, etc.
I do agree that we should probably leave IE users to reload pages and provide graceful degradation. Modern browser users will enjoy the benefit of no refreshing on single page app. However, for some, this is not an option.
Secondly, pushState is useless for single page apps. It's not all about changing the url, what's the way of handling that urls with just a single HTML document? To make index.html 404 page? What about the browser cache?