By Scott Gilbert
Twitter says that returning to traditional means of serving webpages â€œdropped the time to first Tweet to one-fifth of what it was.â€
Even better news for those concerned about the future of the web and the longevity of URLs is the news that Twitter is getting rid of its hashbang URLs. The hashbang syntax was originally designed to allow Googleâ€™s spiders to crawl Ajax content â€” content loaded dynamically â€” but sometime in 2010 hashbang URLs started popping up all over the web, including at Twitter.
The hashbang syntax works well if you use it as it was designed, to surface Ajax content that would otherwise be missed by Google. But it was always an awkward hack, not a cornerstone on which to build a well-designed URL, and extending it beyond its intended use often proves disastrous (as sites like Gawker can attest).
Twitter will begin phasing out hashbang URLs in the coming weeks, starting with its tweet permalink URLs.
â€œWe opted to arrange all our code as CommonJS modules,â€ writes Webb, â€œThis means that each piece of our code explicitly declares what it needs to execute.â€ In other words, each piece of code is aware of what other pieces it needs to work. That means Twitter can tune how it bundles its code, â€œlazily load parts of it, download pieces in parallel, separate it into any number of files, and more â€” all without the author of the code having to know or care about this.â€
Webb doesnâ€™t mention Twitterâ€™s front-end toolkit BootStrap in his post, but rolling together CommonJS and Twitterâ€™s own dependency builder â€” which Webb says is similar to the RequireJS optimizer â€” sounds like a great addition for BootStrap 3.0.