Feeds

Google advises flushing your website

Lessons in load time

Combat fraud and increase customer satisfaction

Web 2.0 Expo Steve Souders is the sort of person who spends his Saturday afternoons measuring website load-times. "You might watch football games," he says. "I watch websites load."

After founding the Exceptional Performance Group at Yahoo! - an effort to improve website speed from the websurfer's point of view - Souders now does similar work inside the Google Chocolate Factory. And on Thursday afternoon, he trumpeted his newest load-time tricks at Tim 2.0'Reilly's Web 2.0 Expo in downtown San Francisco.

Souder's over-arching philosophy is that the best way to improve load-times is to focus on front-end performance. When the typical webpage loads, he says, between 80 and 90 per cent of the wait time occurs after the html document has already arrived.

"In that html document is a manifest where the web developer has dictated what else should be dictated in what order," he told gathered dev types this afternoon, pointing to some typical load-time stats for iGoogle.

"Only about nine per cent of the time the user waits for the page to load is spent getting that html document. The other 91 per cent is all other activity that's driven by client - other http requests have to be made, CSS has to be parsed and applied, JavaScript has to be executed, etc."

Even with a primed cache, only about 17 per cent of iGoogle's wait time is spent on html.

With his 2007 book High Performance Web Sites, Souders detailed fourteen rules for improving front-end performance - yes, it's a Tim 2.0'Reilly tome - and he's now prepping a second book that lays out a whole new bag of tricks.

One of these is best applied to those websites that belie Souder's Performance Golden Rule: sites like Facebook take an unusually long time delivering html. "A page like Facebook takes a long time to do all the database queries to find all your friends and all their comments and all the feeds and stitch everything together. You might have that page spending 30 to 50 per cent of the overall load time just getting the html document."

With such sites, Souder suggests that developers lean the "flush" function available from most popular web programming languages, including PHP, Perl, Python, and Ruby on Rails. With flush - "autoflush" in Perl and "ios.flush" in Ruby - you can start sending your html before the entire document is queued up.

"You can can get enough of the html to the browser so that the browser can parse it and start downloading other resources even though the rest of the html is still being stitched together on the back-end," Souder said. "What flush does is it says 'Whatever you have queued up, send it down to the browser right now.'"

Souders also has a new-found obsession with simplifying CSS (cascading style sheet) selectors. He urges developers to avoid universal, descendant, and tag-child selectors, while sidestepping qualifiers for ID and class selectors.

And when using CSS, he says, you should avoid the @import rule, a way of creating a style sheet within a document and then importing additional rules. If used incorrectly, as Souder says it so often is, @import is a particular drag when pages are loaded on Internet Explorer, which may delay other scripts and other style sheets and scripts until an @import style sheet is loaded in-full.

You can read all his esoteric CSS advice here (PowerPoint).

According to Googler Steve Souder, Google is the only top-ten web property that has bothered to flush its html early. But he's not one to avoid criticizing his employer. He isn't exactly pleased with the drag that Google Analytics and Google AdSense put on third-party websites across the web. But, apparently, he's "working on it." ®

Bootnote

While at Yahoo!, Souders developed a tool known as YSlow that automatically measures website load-times. You can download it here. ®

High performance access to file storage

More from The Register

next story
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Batten down the hatches, Ubuntu 14.04 LTS due in TWO DAYS
Admins dab straining server brows in advance of Trusty Tahr's long-term support landing
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Oh no, Joe: WinPhone users already griping over 8.1 mega-update
Hang on. Which bit of Developer Preview don't you understand?
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
Windows 8.1, which you probably haven't upgraded to yet, ALREADY OBSOLETE
Pre-Update versions of new Windows version will no longer support patches
Microsoft TIER SMEAR changes app prices whether devs ask or not
Some go up, some go down, Redmond goes silent
Ditch the sync, paddle in the Streem: Upstart offers syncless sharing
Upload, delete and carry on sharing afterwards?
prev story

Whitepapers

Designing a defence for mobile apps
In this whitepaper learn the various considerations for defending mobile applications; from the mobile application architecture itself to the myriad testing technologies needed to properly assess mobile applications risk.
3 Big data security analytics techniques
Applying these Big Data security analytics techniques can help you make your business safer by detecting attacks early, before significant damage is done.
Five 3D headsets to be won!
We were so impressed by the Durovis Dive headset we’ve asked the company to give some away to Reg readers.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Securing web applications made simple and scalable
In this whitepaper learn how automated security testing can provide a simple and scalable way to protect your web applications.