Find Work Find Talent

Photo by fhirART

How to Optimize Site Speed, and Why It Matters More Than Ever

Written By Kyle Risley | Mar 24, 2015

It’s important for a website to be fast. This makes sense intuitively, but there’s a whole host of research explaining why site speed is critical from a usability and profitability standpoint as well.

For instance:

  • 40% of users will abandon a page if it takes longer than 3 seconds to load.
  • Delays of just 100 to 400 milliseconds can impact how often users engage with a site.
  • Google and Bing have been incorporating site speed into their search ranking algorithms for several years, albeit in a minor role (it only impacted 1% of queries upon initial Google rollout in 2010, but Google has recently been testing more aggressive measures against “slow” sites).
  • The number of case studies showing how site speed impacts the bottom line of e-commerce companies are too numerous to count.

Further, as of last summer, more Internet users accessed the web on mobile devices than on desktops. Even though web pages generally load more slowly on mobile devices, most users expect them to load about as fast or a little slower than their desktop experience. Bottom line: users want fast sites all the time.

It’s considerably easier to make a website than it is to make a fast website.

With that said, it’s considerably easier to make a website than it is to make a fast website. The good news: there is often low hanging fruit that the average webmaster can seize without a PhD in computer science. Even I have made sites faster and I majored in The Daily Show while in college.

How do I know if my site is slow?

Webmasters have a variety of tools to determine how quickly a page loads, with Google’s PageSpeed Insights and Web Page Test being two of the more popular tools.

Each will provide recommendations as to what can be done to improve a page’s loading time, and the estimated impact of the recommendation. PageSpeed Insights displays these immediately and Web Page Test displays recommendations on the “Performance Review” tab.

In terms of exactly how quickly a page should load, that’s a difficult question. A better way to approach the problem is, “Am I doing everything I can to make my site load as quickly as possible?” Still, it’s only natural to want a concrete answer to “How fast is fast enough?”

Pointing again the Akami and Gomez studies from 2009 and 2010 that I referenced above, most users expect a page to load within 3 seconds. This does not necessarily mean a complete render must execute in under 3 seconds (i.e. every single portion of the page is loaded), but rather the “start render” time should be under 3 seconds, which is when a user no longer sees a blank page and begins to view page content. That is a desirable goal to aim for and something Web Page Test can assist with identifying.

How do I fix my slow site?

Here are some of the most common issues reducing a site’s loading speed:

  • image files are not compressed
  • gzip compression is not enabled
  • static content is not cached
  • server connection is closed
  • HTML, CSS, and JavaScript are not minified

While this may look intimidating, these are actually fairly simple fixes for most webmasters to make, especially if the site in question is running on WordPress. In other cases, a developer might need to be consulted, but if the alternative is running a sluggish site, it’s a worthy investment.

How to Compress Image Files

Compressing image files is exactly what it sounds like: making the file sizes smaller to speed up the transfer time without any discernible decline in quality to users. An Internet win/win.

For WordPress sites, WP Smush.it is a simple solution to compress images in bulk. It’s even compatible with other other popular CMS platforms like Drupal. Otherwise, compressing the images and overwriting the old files using a stand alone tool like Compressor.io is probably your best bet.

How to Enable Gzip Compression

Gzip compression is a server-side process that reduces the number of bytes being transferred between the server and client, often used for text-based files like your site’s HTML, CSS, and JavaScript.

If you’re using WordPress, the simplest way to enable gzip compression is via W3 Total Cache. Otherwise, a more technical approach will be required, which is explained very well by Feed the Bot.

How to Cache Static Content

Caching static content is a great way to speed up site performance for repeat visitors. It saves local copies of certain pieces of content (the logo, for instance) instead of asking the server to resend 100% of the page contents to the client upon each visit.

Again, this is made quite simple by W3 Total Cache for WordPress sites, but is also pretty easy to implement with a quick file edit for Apache, IIS or Nginx servers. If this sounds absolutely horrifying, it’s a good idea to consult with someone knowledgable. Editing server files can be a great way to tank the site immediately.

How to Set a Server Connection to Keep-Alive

Keep-alive, also known as a persistent connection, allows a server to request many files without creating a new connection for each request. With a closed connection (which closes after each request) the volume of server calls can increase the amount of time required to load a page, which isn’t fun for anyone.

This switch can be flipped in the server configuration file, which is usually httpd.conf for Apache servers and the http_core_module on Nginx servers. Again, this requires a bit of FTP savvy (and server access), so please proceed accordingly.

How to Minify HTML, CSS, and JavaScript Files

Minification is a process that makes code lighter and quicker for browsers to process by removing redundancies and unnecessary characters, without altering the functions performed. It’s somewhat analogous to image compression, except for text files. Again, W3 Total Cache makes this process quite simple for sites running WordPress, but the process is a bit trickier if the site in question is not running on WordPress.

While minifying a piece of code is simple enough and lots of free tools will do it for you, having a process run across all applicable files on a server and automatically updating them is more complicated. Google has published minification guidelines to help with this process, but this is definitely something for a server-side engineer to investigate on a site-by-site basis.

Hopefully this helps your site run a little bit faster than it did yesterday. For further reading, I highly recommend Google’s PageSpeed Insights Rules and Feed the Bot’s pagespeed articles. For more advanced WordPress techniques, I recommend Smashing Magazine’s How to Speed Up Your WordPress Website guide.

Kyle Risley is an SEO expert at Vistaprint and also provides freelance SEO consulting. When he is away from his keyboard, he’s usually at a concert or digging through records.

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.