Why do websites take so long to load?

A behind-the-scenes look at what could be making your site slow

internet web page searching worldwide web 000001229173
Credit: iStockphoto

How long do you wait for a page to load before giving up?

Five seconds?

Three seconds?

According to Slate, internet pages took about 30 seconds to load back in the digital dark ages of 1996. That’s almost unimaginable now, when the average user bounces after a fraction of that time. We expect a fast, responsive internet experience even on our mobile phones. Anything less leads to page abandonment.  

“These days, even 400 milliseconds — literally the blink of an eye — is too long, as Google engineers have discovered. That barely perceptible delay causes people to search less,” writes Steve Lohr for The New York Times.

A poll by KISSmetrics found that:

  • 40 percent of people abandon a website that takes more than three seconds to load

  • 47 percent of consumers expect a web page to load in two seconds or less

  • 73 percent of mobile internet users say that they’ve encountered a website that was too slow to load

There are a few obvious reasons why a page might be slow to load. It could be graphics-heavy or bogged down with animation, auto-loading videos, or other bells and whistles. Ads, particularly those of the auto-play video variety, can slow down load time considerably. Or hey, it might even be a problem with your internet connection.

But there’s a hidden issue that may be causing delays. The JavaScript code might be outdated, unnecessarily bulky, or even gaming the analytics.

JavaScript: The Good Parts flickr/nyuhuhuu

 

Five years ago, JavaScript was in a poor state. Ad tech companies embedded clunky iframes that would sometimes load entire web stacks. Loading a single publisher website was often like loading ten websites in parallel in a single tab. Many of these ad tech vendors haven't upgraded, so this issue exists today.

Parse.ly, for its part, has made a focused effort to maintain a slim JavaScript integration to collect the data it needs for useful reporting to digital publishers -- using as few bytes as possible. Our team wrote all the code from scratch, forcing async-loading and beaconing back the minimum data needed.

With bad actors among the ad tech industry popping up every day who are happy to take advantage of this mindset, it's no surprise that the page load situation has gotten out of control.

In response, companies like Facebook are bringing products like Instant Articles to market for mobile. More recently, Google announced Accelerated Mobile Pages (AMP), an open source project supporting near-instant access to quality content while simultaneously enabling publishers to increase mobile revenues across ads and subscriptions.

“AMP essentially asks you to build a parallel-universe version of your site that strips out not just anything that’s slow, but anything that might be slow,” explains Joshua Benton for Nieman Lab. “You know how ad blockers block all ads, whether they’re perfectly reasonable or aggressively terrible? AMP HTML kills all JavaScript, not just bad JavaScript.”

The next time you find yourself getting frustrated with a website that seems to be loading at a glacial pace, know that there may be scripts running behind the scenes. JavaScript blockers may be the way of the future for savvy users, but site builders would be much better served by streamlining their code before it becomes a problem for people visiting their pages.

This article is published as part of the IDG Contributor Network. Want to Join?

To express your thoughts on Computerworld content, visit Computerworld's Facebook page, LinkedIn page and Twitter stream.
Windows 10 annoyances and solutions
Shop Tech Products at Amazon
Notice to our Readers
We're now using social media to take your comments and feedback. Learn more about this here.