Scalable WordPress Hosting for Developers

By Keanan Koppenhaver

WordPress powers forty-three percent of all websites, supporting everything from small hobby sites to major sites such as Rolling StoneTechCrunch, and even The White House. However, if you want to scale to accommodate millions of hits a month, you need to choose your hosting wisely. When your site is business critical, you need scalable hosting that can support its performance and security needs. WordPress.com is one such solution. It accommodates the growing demands of your site, allowing your hosting to scale with you.

When it comes to WordPress specifically, it’s important to note the distinction between WordPress.com and WordPress.org. WordPress.org is where you can view documentation related to WordPress, download the open source code, and find information on the project itself. WordPress.com, on the other hand, is a complete hosting solution for your WordPress sites. It comes with WordPress pre-installed, and manages all the infrastructure for you.

In this article, you’ll take a look at the importance of scalable hosting, as well as how to ensure that your sites are as highly available, secure, and performant as possible.

Why is Scalable Hosting Important?

Especially when developing a complex site, it’s important to have hosting that can grow with your site as it needs to support more traffic, a greater number of plugins, or different types of editorial content. Unfortunately, many shared hosting platforms have some difficulty meeting this need, and there are a number of common problems when you’re working with shared hosting.

  • Speed: One of the major downsides to shared hosting is speed. Because you’re sharing the same resources with many other customers, there are limits to how fast your site can load, especially if your site experiences heavy traffic, or someone else on your shared server starts to experience heavy traffic. Even though many of these services claim to offer “unlimited” bandwidth or other resources, there are practical infrastructure limitations due to the fact that you’re sharing resources with others.
  • Security: Security can also be an issue with some of the shared hosting providers, once again due to the fact that multiple sites are sharing resources. Depending on how the infrastructure is configured, a vulnerable plugin on someone else’s site could affect yours, even if you keep all your plugins, themes, and WordPress core up to date.
  • Stability and uptime: Because shared hosting means that you’re sharing the server resources with other customers, it isn’t as scalable as other forms of WordPress hosting. As your site grows, you may start to see issues with site stability or uptime, which increases the time you need to spend maintaining your site. Uptime is one of the most important metrics around a site’s performance, but is something that shared hosts struggle with, especially as a site grows.
  • Support: While shared hosting often comes with a lower price point, it can be difficult to get effective or timely support. When you’re choosing a host, you want to know that you’ll be able to talk to someone in the event of any problems with the infrastructure your site is hosted on. Email-only support can leave you waiting for days, and many shared hosting providers don’t offer any type of live support, such as chat support.

Your Needs Change as Your Site Grows

Shared hosting can be a great way to start, especially for small-scale hobby sites and other sites that aren’t business critical. However, when you are doing work for clients or customers, you often have requirements that even the best shared hosting providers aren’t always equipped to handle.

Security

As your site grows, you’ll likely need to add more users with permissions to log in and manage the site. Thanks to WordPress’s user roles, it’s easy to restrict what parts of a site users are able to change. However, as this list of users grows, so do the opportunities for less-secure practices to sneak into your site and potentially compromise things.

One major concern is authenticating users who need access to the backend of your site. With a solution like WordPress.com, you get their Secure Sign-On, which allows you to use a single set of credentials to access both the WordPress.com dashboard and the backend WP Admin dashboard of any of your sites, quickly and securely. It also allows you to enforce two-factor authentication to ensure that everyone who has access to your site is accessing it in the most secure way possible.

Cost Containment

A common pattern among hosting companies is to be relatively cheap if all you need is the bare minimum, but charge for additional features a la carte, such as a content delivery network (CDN) or increased bandwidth. While this might make sense for someone just starting out, more advanced sites may need many additional features like this, which can rapidly make hosting your site an expensive proposition. A better choice is finding a hosting provider that gives you everything you need to scale your site for a flat rate.

Scalability

As your site scales up, you’ll be adding more content and getting more traffic. Your server needs to be able to handle the increased demands and load that a bigger, more highly-trafficked site entails. By using a hosting company that performs well even under traffic spikes and generally increased demands on the server, you can ensure that your site won’t be held back by the hosting infrastructure it sits on. You don’t want your site to slow to a crawl—or go down entirely—because of a sudden increase in attention.

In independent, third-party testing, WordPress.com stands out for its top tier performance, even under increased load. When comparing hosts, this ability to handle increased infrastructure demands should be a primary consideration. You don’t want your website to go down just when it’s getting more exposure than normal or while your business is growing.

Performance

In addition to all of these other factors, you want your hosting environment to be fast. Sites that perform better and load more quickly are more attractive to customers and do more business overall. And once again, in third-party tests, WordPress.com has been found to be the fastest web host out of all hosting options that were benchmarked.

Making Your Site More Scalable

No matter where your site is hosted, there are some best practices that you can implement to make it more scalable.

Use a Content Delivery Network

Serving static assets from a dedicated CDN, instead of serving them from your web server, frees up your web server to process requests to the actual site, and helps these resources load faster for users around the world. When you can, you should always use a CDN to make your site load more efficiently. If you decide to use WordPress.com for your site’s hosting, you can take advantage of the Jetpack Image CDN and offload the responsibility of serving static assets, such as images, JavaScript, and CSS, to the CDN. This will ensure that even as you add more media to your site, performance won’t be affected, because the heavy lifting will be handled by your CDN.

Caching

Another way to make your WordPress site more scalable is to effectively utilize caching. Database queries and external API calls that might slow down the performance of your page should be cached in order to maintain performance. Loading every last piece of information needed to render a page from the database on every page load can really start to bog down your site, especially if that load time involves requests to other APIs or other external resources. By caching some of these performance-impacting pieces of the page load process, you can help your site load more quickly.

One way to do this is by using the transient system built into WordPress, which can store the result of a long-running database query or API call in a single field of the database, allowing it to be looked up easily. In general, any data that takes a long time to generate, but can easily be regenerated if necessary, is a good fit for a transient. Transients expire over time, so they won’t always be cached, but when they are, they can significantly speed up page load time. As an example, let’s look at how you might cache an external API call. This example uses a free cat facts API, which will give your site access to a new cat fact every day.

<?php
// If we already have the API call cached, just use that and we can be done
if( get_transient( 'cat_fact' ) ) {
    $cat_fact = get_transient( 'cat_fact' );
} else {
    // If the fact isn’t already cached, we need to fetch it from the API
$response = wp_remote_get( 'https://catfact.ninja/fact' );
    $body     = json_decode( wp_remote_retrieve_body( $response ) );
    $cat_fact = $body->fact;

    // Then we need to store it in the transient (in this case for one day) so that we don’t have to make the API call again 
    set_transient( 'cat_fact', $body->fact, DAY_IN_SECONDS );
}
?>

There are also caching plugins that do some of this work for you. However, in many cases, hosting providers implement their own caching systems that conflict with these plugins, so be sure to check with your hosting provider to see if the caching plugins you’re interested in are compatible with their infrastructure. WordPress.com, for example, maintains a list of plugins that are incompatible with hosting your site on WordPress.com, because those plugins provide functionality that is already built into WordPress.com.

Autoloading

Another improvement you can make to your site, regardless of your hosting provider, is checking how many autoloaded queries you have. By default, certain options in WordPress are autoloaded, meaning they’re queried from the database on every page load, regardless of whether they’re needed on that particular page.

By only autoloading the options that are actually required everywhere on your site, you can reduce the number of database queries you are making on each page load, which will make your site load much more efficiently.

If you’re not sure what’s getting autoloaded, you can check the total size of all the options you are autoloading by running the following SQL query:

SELECT SUM(LENGTH(option_value)) as autoload_size FROM wp_options WHERE autoload=’yes’;

This will give you the total size, in kilobytes, of options that are autoloading. If this is more than a megabyte, you should investigate what you are storing in wp-options and what’s being autoloaded to see if there are any optimizations you can make here.

Wrapping Up

When it comes to building and growing your WordPress site, the last thing you want to worry about is your hosting provider not being able to handle your expansion. By choosing scalable WordPress hosting that takes care of all of the core features required to host your site, you’ll be able to grow without issue, keeping your customers and users happy.

By using WordPress.com to host your WordPress site, you can be sure you’re getting a fast, secure hosting environment that will scale with you, and includes everything you need to take your site to the next level.