DreamHost ACADEMY

Grow

You’ve done the hard work of building a website and cultivating an audience. You deserve to get a return on your time and investment — don’t you think?

15 Ways to Improve Website Performance

The days when you had to wait minutes for websites to load are long gone. Now that many of us have access to high-speed internet connections — not only in our homes, but wherever we go — there’s little excuse for slow website speeds.

If you have a WordPress website, you’ll need to keep a close eye on its loading times. Optimizing loading speeds not only makes for a smoother user experience but can also prevent visitors from going to your competitors instead.

Fortunately, there are a lot of ways to improve site speed, and in this article, we’re going to explore 15 of the best strategies. Implementing even a few of these approaches should help your site load faster, so let’s get right to it!

Want Blazing-Fast Website Performance?

Partner with DreamHost! We’ll make sure your website is fast, secure, and always up so your visitors trust you.

Why You Should Improve Your Website Performance

One mistake that many website owners make is assuming their sites are fast enough without taking a closer look at their real performance. The truth is that most sites these days load relatively fast if the end-user has a decent internet connection.

However, your idea of “fast” and that of your visitors may be quite different.

Studies show that most users have remarkably little patience when it comes to long loading times. Almost 47% of users expect every website to load in a few seconds or less. The golden page load speed for most sites is around three seconds. For every additional second that a page takes to load, you can experience a reduction in conversions of up to 7%.

If you’re not sure how fast your WordPress site is, now is the time to find out. Many factors can affect site performance and there are several tools you can use to run simple speed tests. One of our favorites is PageSpeed Insights because it gives you access to a broad range of performance metrics.

All you have to do is type in the URL you want to check out and run a test.

The Google PageSpeed Insights home page.

Keep in mind that even if your results are under the three-second mark, that doesn’t mean there isn’t any room for web performance improvement. Optimizing your loading times becomes even more critical as your site grows in popularity, and shaving off a few milliseconds now can make a big difference down the line.

Since you’ll be optimizing several critical aspects of your WordPress website, we recommend that you create a backup before you get started. As a rule of thumb, it’s smart to create backups often, particularly before making big changes.

15 Ways to Improve Your Site Speed

It’s important to understand that there’s no silver bullet for improving loading speeds. Some methods may give you a better bang for your buck, depending on how your website is currently set up.

However, if you want to ensure that your site loads as fast as possible, then you’ll need to implement as many optimization techniques as possible. Here are 15 of the best strategies you can try to boost your website speed.

1. Choose the Right Hosting Provider

Every hosting provider offers a different baseline performance out of the box. Moreover, you usually can’t compare the performance of a web host’s shared plans with more advanced offerings such as dedicated servers.

Ideally, you want to use a web host that offers excellent performance across the board. Every web hosting provider will tell you that it’s the fastest, so it’s your job to compare features and prices and to read as many reviews as possible before you make a decision.

You can always change web hosting providers down the line, but that tends to be a hassle. If you choose the right service and hosting plan, your WordPress website should be blazing fast from the start.

2. Leverage Browser Caching

Caching is one of the most critical steps to improving your site’s loading times. By enabling browser caching, you tell your visitors’ browsers to store some (or all) of your site’s static files on their computers temporarily.

Since those visitors won’t need to reload your site fully every time they return, loading times should be much faster on subsequent visits. There are plenty of ways to leverage browser caching in WordPress, and if you haven’t set it up yet, now is the perfect time to do so.

3. Enable Keep-Alive On Your Web Server

Usually, when you visit a website, your browser establishes a connection to its server and uses that to transfer the files it needs to fetch. However, if your server isn’t properly configured, users might need to establish new connections for every single file they want to transfer.

Naturally, that’s not an efficient way to load modern websites with dozens and sometimes hundreds of files. To avoid that situation, you want to configure your webserver to use what’s called a “keep-alive” HTTP header or persistent connection.

Here you can find instructions on how to do that for the two most commonly used web server software options:

  1. How to enable keep-alive for Apache
  2. How to enable persistent connections for NGINX

By default, most Apache and NGINX setups should use persistent connections. However, if you’re not sure how your server is configured, it doesn’t hurt to double-check.

4. Enable GZIP Compression

As its name implies, GZIP is a compression method that enables you to reduce the file sizes for several elements within your website. In some cases, simply enabling GZIP compression can reduce the weight of your pages by up to 70%.

The smaller a page is, the faster it will generally load. Many web hosts (including us here at DreamHost) enable GZIP compression for almost all plans out of the box. If yours doesn’t, you can easily add this function to your WordPress site by following our step-by-step tutorial.

5. Avoid Landing Page Redirects Whenever Possible

In the past, many people recommended that you set up a mobile-friendly version of your WordPress website, both for Search Engine Optimization (SEO) purposes and to keep users happy. For that approach to work, you had to implement landing page redirects that sent mobile users towards the “appropriate” version of your site and make them cacheable to speed things up further.

Now, since mobile devices have overtaken desktop browsers when it comes to overall traffic, it doesn’t make much sense to design multiple versions of your website. Instead, you want a single, mobile-friendly design that scales across all possible resolutions.

DreamHost’s home page on a mobile device.

As a rule of thumb, it’s best to avoid redirects whenever possible. Each redirect is another hoop that users have to jump through, and by reducing them, you can improve your site’s loading times.

6. Use a Content Delivery Network (CDN)

On most types of hosting (except cloud hosting), your website resides in a single server with a specific location. Every visitor needs to connect to that server in order to load your website, which can lead to bottlenecks.

CDNs are clusters of servers around the world that store copies of websites. That means, for example, your site can be hosted in the US but use a CDN with servers in Latin America, Europe, and the rest of the world. If someone from Brazil tries to visit your site, that CDN will serve your site from its Latin American servers.

This setup provides you with two advantages:

  1. It reduces the load on your servers.
  2. It translates to lower loading times for international visitors.

There are a lot of great CDN solutions for WordPress. As you might expect, most of those services don’t come for free. However, if you run a popular website, spending a bit of money on a CDN can significantly impact that site’s loading times.

7. Disable Query Strings for Static Resources

Query strings are the suffixes that you sometimes see at the ends of URLs, starting with special characters such as question marks or ampersands. Here’s a quick example of an URL with a query string, and one without:

  • yourwebsite.com/style.css?ver=2
  • yourwebsite.com/style.css

The goal of query strings is to enable you to identify specific versions of an asset or get around caching restrictions. You can use query strings to “bust” the cache and force your browser to load the latest version of a file.

That sounds great in practice, but query strings usually don’t play nicely with CDNs or custom caching solutions (both of which you should be using, as discussed earlier). Ideally, your website should be configured to serve the latest versions of any files that it instructs users to cache.

That, in a nutshell, should remove the need for query strings. The good news is that there are numerous ways to disable query strings for your website, whether you’re using WordPress or another solution. If you implement caching on your site, then you’ll want to make sure to tick off this box as well.

8. Specify a Character Set

Character sets are groups of numbers that include representations for every text element you see on the web. For example, UTF-8 — which is the most popular set for websites — includes unique numbers for over 10,000 characters.

Many websites specify the character set each page uses within their HTML document headers, like this:

Content-Type: text/html; charset=utf-8

Indicating what character set your site uses can reduce the time it takes for browsers to interpret or parse the rest of its HTML documents. If you want to modify or indicate a specific character set for your website without editing each page’s header, there are plenty of ways to do so.

If you’re using WordPress, you can specify which character set your website uses by modifying its wp-config.php file, which should look something like this:

define('DB_NAME', ‘exampledatabase’);

define('DB_USER', 'exampledbuser');

define('DB_PASSWORD', ‘database password here’);

define('DB_HOST', 'mysql.example.com');

define('DB_CHARSET', 'utf8');

define('DB_COLLATE', '');

Notice that there’s a specific line that indicates the character set for your site. As we mentioned before, UTF-8 is the de-facto option for most sites, but it’s far from the only character set that you can use.

9. Minify Your Website’s Scripts

Most modern websites come with multiple CSS and JavaScript files. Each additional script your site needs to load has an impact on its performance. In most cases, removing that code isn’t an option, since it usually enables you to add critical features to your site.

What you can do is minify those scripts. Minification is a simple process that involves removing unnecessary characters from your site’s code. To give you an idea of what that looks like, here’s a simple CSS code snippet from our WordPress code minification guide:

#bluetext { font-size: 2em; color: blue; } #redtext { font-size: 1em; color: red; }

Now here’s what that code looks like after minification:

#bluetext{font-size:2em;color:blue;}#redtext{font-size:1em;color:red;}

By removing the empty spaces within that code, we can reduce its file size. For a few lines of code, that might not have a significant impact. However, when you consider just how many scripts a modern site has, minification can make a noticeable difference in loading times.

If you’re not using WordPress, you can manually minify your site’s scripts, using online tools such as Minify.

Minifying your website’s scripts.

Most minification tools work much the same. All you have to do is enter the code you want to minify, and the tool removes all the unnecessary data from those snippets without any further input on your end. It’s a simple way to boost your website speed.

10. Reduce Domain Name System (DNS) Lookups

Every time you type in a URL, your browser needs to look up the IP address it corresponds to through its DNS records. Those queries are usually fast, but if your website includes a lot of resources from third-party websites, DNS lookups can add up quickly.

Let’s say, for example, that your website uses several third-party JavaScript libraries hosted on external sites. In that case, you’d need to indicate the URLs for those libraries within your HTML files. When visitors try to access your site, their browsers would need to look up each URL for those libraries.

You can reduce the number of DNS lookups on your site in several ways, which include:

Hosting third-party resources and scripts on your site is a great way to ensure that every file that visitors load comes from a consistent source or URL. With most libraries and scripts, you’re free to copy and host those files on your server, so you should be in the clear.

If you’re not certain what impact third-party scripts may have on your site’s loading times, we recommend running a quick speed test using a tool such as GTmetrix.

An example of a website with multiple DNS lookups.

It only takes a few seconds to analyze a URL, and your report will include information on how many DNS lookups occur on your site.

11. Use a Well-Optimized WordPress Theme

WordPress themes can have a significant impact on your site, beyond just affecting its style. These days, many themes pack dozens of unique features, custom page builders, and much more. All that extra functionality can come at a cost, however, which is poor performance.

Not all WordPress themes are well optimized, which can translate to slow loading times even if you’re doing everything else right. Since it’s not feasible to test dozens of themes personally on your own servers, we recommend that you conduct plenty of research before choosing a template.

Some of the most popular free WordPress themes.

There are hundreds of articles on the web about the fastest WordPress themes, and it’s also important to look at independent reviews. Just as with your web host, doing your homework before you make a choice here can save you a lot of headaches down the line.

Get Your Site Up to Speed

With 20+ years of experience supporting millions of sites, we’ve perfected a process to make your website super fast at an affordable price.

12. Remove Unused WordPress Plugins

Trying out new plugins can be fun, but it’s important that you don’t keep the ones you aren’t using. By definition, plugins add extra code and functionality to your website, which can impact its loading times. If you’re not using those features, then you’re slowing down the user experience for nothing.

In our experience, most plugins shouldn’t impact loading times dramatically. However, it only takes seconds to disable the plugins that you’re not using.

We recommend that you check your plugins page every couple of months, identify the ones you don’t use anymore, and turn them off. If you don’t miss them after a while, then go ahead and uninstall them.

13. Optimize Your Website’s Images

We’re willing to bet that you can’t remember the last time you saw a website without images, and that’s not a coincidence. Images make everything better, and they’re a core part of modern web design.

However, high-quality image files tend to weigh a lot. In turn, large file sizes mean longer loading times. There are two main ways to correct that issue:

  1. Compressing images before you upload them to your website
  2. Resizing images to adjust to modern screen resolutions

There are lots of tools you can use to compress images with minimal or no loss in quality. If you’re using WordPress, you have access to plugins that can automate the entire processand help you resize images while you’re at it.

That last part is key since there’s no reason to serve images with massive resolutions if your visitors are mostly accessing your site from laptops or mobile devices. By combining compression with resizing, you can reduce image file sizes drastically and speed up your website simultaneously.

14. Put CSS at the Top and JavaScript at the Bottom

By “top” and “bottom,” we mean the head and footer sections within your pages’ HTML documents. When you visit a website, your browser has to load all of the scripts within the head tags before it can render the rest of the page.

That’s not a problem with CSS, because those files contain the markup language that enables you to style your website. If you remove your CSS files or block them from rendering, your site will still work, but it probably won’t look very good.

JavaScript, on the other hand, usually isn’t critical when it comes to rendering pages. For example, you might have code that enables analytics on your site or powers an email submission form. You can move that code to your HTML document’s footer (or just before the end of the body tag), and those functions will still work once the page finishes loading.

That practice is what we call deferring JavaScript loading. The result is that your website will still work just the same, but it will start rendering faster because browsers don’t need to finish loading all that JavaScript before they start showing your content.

15. Fix Broken URLs

Setting aside SEO or page performance, broken URLs can affect your website negatively. Having too many broken URLs on your site can waste its “crawl budget,” preventing search engine bots from indexing other critical pages and costing you visitors in the long run.

Moreover, broken URLs give users the impression that your website isn’t properly maintained. This can drive visitors away, increasing your site’s bounce rate in a very similar way that slow pages do.

Ideally, you should crawl your website periodically to make sure all of its URLs are working. You can easily do that using tools such as Screaming Frog’s SEO Spider or Google Search Console.

Using Google Search Console to crawl your website for broken URLs.

If you find broken URLs on your site, you can fix them manually or use a plugin. You may also want to ensure that your site doesn’t have a misconfigured .htaccess file, which can sometimes cause broken links.

Ready to Get Started with Website Optimization?

Whether you need help with lazy loading, installing a caching plugin, or using a Content Delivery Network, we can help your loading speed! Subscribe to our monthly digest so you never miss an article.

Unlock Your Best Website Speed

Optimizing your website to improve its performance can seem daunting. As you can see, there’s a lot that you can do to reduce loading times. However, you don’t have to implement every single optimization at once.

What’s more, many of the tasks we’ve outlined in this guide are things you only have to do once, such as choosing the right WordPress theme. As your site grows, you’ll have the time to finetune its performance even further, providing a better user experience and keeping your site loading smoothly at all times.

If you want to ensure that your website loads as fast as possible, it helps to choose a web host that offers great performance right out of the gate. All of our DreamPress plans are optimized to provide you with fast loading times, so don’t hesitate to check them out!

We’re Here to Help

If you have questions or just could use some help figuring some thing out, get in touch. Our team of web experts has been in the business for over 20 years and knows how to help you figure out the right next steps.