5 ms·
This is fantastic news. From the recent tweets by https://twitter.com/danwrong https://twitter.com/danwrong it looks like Twitter are moving entirely to HTML5
by simonw 15y ago
This is fantastic news.
From the recent tweets by https://twitter.com/danwrong https://twitter.com/danwrong it looks like Twitter are moving entirely to HTML5 pushState, and leaving IE users with full page refreshes rather than continuing to serve them #! - Dan says "I'm not sure why everyone is so adverse to page refreshes these days. You can make them fast too."
Of course, Twitter are going to have to include a piece of JavaScript on the http://twitter.com/ http://twitter.com/ homepage which checks for a #! and redirects the user to the corresponding page - and they'll have to keep that JavaScript there forever, since they have nearly two years worth of links that they need to avoid breaking. One of the many reasons #! is such a nasty hack.
In terms of performance, this is going to make Twitter a lot /faster/ for me - I often open Twitter profile pages in new windows (due to working on Lanyrd) and each new window has to pull in and execute a HUGE chunk of JavaScript before it will display the page. Being able to just load a regular HTML page will be much faster for me.
- joshuahedlund 15y agocan't they just do a one-line .htaccess regex replace? or is it more complicated than that?
- tkaemming 15y agoThe redirection has to be done on the client-side, because the server never receives the fragment identifier as part of the URL.
- simonw 15y agoNope, because anything after the # isn't included in the HTTP GET request made to the server - so a .htaccess-level redirection won't see it. You have to execute actual JavaScript on the client to read and redirect the #! bit.
- deleted 15y ago[deleted]
- sirclueless 15y agoThat is the fundamental problem with hashbangs: the server receives "GET / HTTP/1.1" and the client uses javascript to render the hashbang. The server has no idea a hashbang is present until after it sends javascript to run client-side.
- deleted 15y ago[deleted]
- mnutt 15y agoIt doesn't sound like they're switching to rendering on the backend, though. So you're most likely still going to have to execute a huge chunk of javascript before displaying the page, though hopefully it will get faster.
- n8agrin 15y agoDan doesn't say anything about where the rendering will happen. Most sites these day (including Facebook, Gmail, etc) have to execute "a huge chuck of js" before displaying the page. I have been told by some people in the know that they have come up with a system similar to pjax for certain page components, though that may have changed.
- dewitt 15y agoTrue for Gmail, though Google+ renders most of the initial page view in static HTML/CSS, then progressively enhances subsequent pages using JS and a variety of techniques, including embedded frames and pushState. There's a lot that goes into making G+ so fast, and pre-rendering a big is part of it. By way of comparison, view the following two links in a javascript-less browser (or just view source): $ w3m http://twitter.com/#!/danwrong/status/171680703824662528 $ w3m https://plus.google.com/117377434815709898403/posts/f35f8QvHab7 The first link contains nothing but boilerplate and the JS that lazily loads the real content, whereas the second contains the actual content ready for the client to render immediately (and index, if you're a crawler). This is a good move by Twitter. I wholeheartedly endorse it.
- pak 15y agoWouldn't they have to, to support browsers without pushState? And even if they used terrible JavaScript hackery to get around that (serve same content for every URL, have clients AJAX in content based on location.href) how would they support web crawlers? I thought the whole point of the hashbang was that you would get the original content (or an equivalent representation) by removing it from the URL, so I'd think they still support backend rendering at some level.
- 15y ago
- zeeg 15y agoTo be honest, I'd prefer maintaining a single JS redirect on the main page, rather than many server-side regular expressions trying to redirect to appropriate pages.