Twitter Upgrades To Load Tweets Five Times Faster

Twitter engineers have started an upgrade of the microblogging platform that will increase the page loading speed by an average of five times.

The performance boost is achieved by moving the rendering of the Twitter pages from the user’s browser to the server. Other changes include the disappearance of hashbangs (#!) from permalinks, and optimisation of the JavaScript code.

The upgrade will allow Twitter to take advantage of new browser technology and pave the way for fresh multimedia features.

Early bird gets the worm

Twitter, which has 10 million users in the UK, was built around a web application architecture that executed most of the code on users’ machines. According to the engineering manager of company’s web core team Dan Webb, the fully client-side architecture, while having a number of advantages, lacked support for various optimisations available only on the server.

Twitter decided to take the execution of JavaScript completely out of the render path. “By rendering our page content on the server and deferring all JavaScript execution until well after that content has been rendered, we’ve dropped the time to first Tweet [the amount of time it takes from navigation to viewing the first Tweet on each page’s timeline] to one-fifth of what it was”, said Webb.

The transfer to the servers also allowed Twitter to reduce differences in performance across browsers.

Another noticeable change is the simplification of permalink URLs, which will no longer use hashbangs (#!). “With hashbang URLs, the browser needs to download an HTML page, download and execute some JavaScript, recognise the hashbang path (which is only visible to the browser), then fetch and render the content for that URL,” explained Webb. Removing the need to handle routing on the client has contributed to the improvement in initial page-load performance.

Finally, by splitting the JavaScript into modules, engineers have enabled the client to only download the JavaScript necessary for the page to work, resulting in a smaller payload over the wire, fewer lines of code to parse and quicker execution times, Webb said.

Twitter will continue to roll out this new framework to the site in the coming weeks. Once the changes are in place, the company plans to implement partial page reloads and begin to overhaul the server side of the application.

Are you an expert on social networks? Take our quiz!

Max Smolaks

Max 'Beast from the East' Smolaks covers open source, public sector, startups and technology of the future at TechWeekEurope. If you find him looking lost on the streets of London, feed him coffee and sugar.

Recent Posts

Ericsson To Cut 1,200 Jobs in Sweden Amid ‘Challenging’ Market

Swedish telecoms giant Ericsson blamed “challenging mobile networks market” and “further volume contraction” for job…

15 hours ago

FTX’s Sam Bankman-Fried Sentenced To 25 Years In Prison For $8bn Fraud

Dramatic downfall. Sam Bankman-Fried sentenced to 25 years in prison for masterminding $8bn fraud that…

16 hours ago

Elon Musk Orders FSD Demo For Every Tesla US Sale

Fallout avoidance? Tesla buyers in the US must be shown how to use the FSD…

17 hours ago

Amazon Pumps Another $2.75 Billion Into Anthropic

Amazon completes its $4bn investment into AI firm Anthropic, after providing an additional $2.75bn in…

19 hours ago

The Sustainability of AI

While AI promises unparalleled efficiency, productivity, and innovation, questions regarding its environmental impact loom large.…

21 hours ago

Trump’s Truth Social Makes Successful Market Debut

Shares in Donald Trump’s social media company rose about 16 percent after first day of…

22 hours ago