Optimizing WordPress for Speed

There’s a lot of hype around page speed, and the hype is usually centered around 2 main points:

  1. SEO: The Google algorithm measures page load time as one of its many search ranking factors
  2. UX – User Experience: It’s well documented that slow loading websites create a poor user experience, increase bounce rates, and lower conversion rates

For those reasons, optimizing your WordPress site for speed is generally worth the time and effort, and here are a few simple steps that you can take to get started with speed optimization.

Measuring Page Speed

Speed is important, but testing your speed can be tricky. There are a variety of tools and methods to test page speed, but most test your site in ideal circumstances, and no two tests are the same.

One solution: find a benchmarking tool from a reputable source, and then test multiple WordPress sites (including your own) to get a sense of what is good, bad, and ugly. By comparing the benchmarks of your site against other reputable WordPress projects, you’re now able to set a reasonable goal for your efforts.

Improving Page Speed

Caching is generally the defacto first solution for improving page load times, as serving traffic from the cache can be up to 1,000 times more efficient than serving it from PHP.

Say you serve your site without any caching: it might take 1500 milliseconds to generate that page, where serving that same page from the cache might take 5 milliseconds. Using Pagely’s VPS1 solution as an example, you might be able to do 8 PHP requests a second without caching, while you can do 8,000 requests a second with caching.

pagely high availability VPS hosting
Pagely High Availability VPS Hosting Tech

It’s important to note that larger, more complex sites often have specific caching requirements, where it makes sense to cache some things while leaving others alone. This customization is typically more resource-intensive. But, if your managed hosting team and platform can help you move 20% of your traffic to the cache via a custom-built cache key and additional capabilities, then that can make up for the fact that your dedicated hardware is more expensive.

Check Your Code

Your code and plugins play a substantial role here as well. If your project is laden with inefficient code, throwing more hardware at the problem isn’t a financially prudent, nor scalable, solution. You need to fix those inefficiencies, and a good hosting provider can help with hands-on guidance.

Optimize Your Images

This might be common sense, but it’s worth noting: large image files are page speed killers.

Quick tips for images:

  • Upload images at the smallest dimensions required by your design
  • Compress images locally before uploading, or run a server-side compression plugin
  • Use the SVG format for graphics when possible

Upgrade Your Hosting

Where you host WordPress plays a substantial role in how fast your site will load. Many inexpensive hosts use outdated hardware and jam as many accounts onto a single server as possible, leaving fewer resources available to you. These same hosts are often vague about how those resources are allocated and what their infrastructure looks like, making it hard to know where you stand.

If you don’t know how your host prioritizes the resources running your project, how can you compare them to others or effectively improve your page speed?

What to Look For in a Fast WordPress Host

When reviewing a current or potential hosting partner, transparency is key.

Building on that, your host is only as fast as the infrastructure their tech is built upon, so look for a host with reputable technology partners.

Arguably one of the most well-known names in hosting is, of course, Amazon. Amazon powers major brands like GE, Expedia, Pinterest, LinkedIn, Dow Jones, Adobe, Pfizer, and even NASA by supporting the best hosting companies with 64-bit machines in their data centers.

So, what tools should your hosting provider have in place to keep your site running quickly?

A CDN

A content delivery network is a geographically distributed network of proxy servers and their data centers. By serving a user content from a location physically closest to where they are, your site performs faster and loads better for each visitor.

For example, at Pagely, our CDN, PressCDN, is built specifically for WordPress and services clients across five continents, serving photos, images, and static assets from a global network of servers.

This means faster download speeds for your site visitors.

pressCDN in atomic
PressCDN Sample Dashboard with Statistics

A Web Server Full Page Cache

With a proper caching mechanism in place, content is cached at one or several points of presence (POP). When a request is made for a site, the POP closest to the user delivers the cached page. This means faster speeds to every visitor.

To use Pagely as an example again, we built PressCACHE as a global WordPress acceleration system which works much like a CDN but is specifically designed to cache and serve WordPress page output. This makes your site available instantly, from anywhere.

For more on caching, check out Maura Teal’s talk on The Balancing Act of Caching in WordPress.


A PHP Stack Optimized for WordPress

There are several small PHP concepts that add up to improved performance and speed. First, tuning PHP for WordPress typically involves the right number of php-fpm works for the hardware to give maximum throughput while limiting overhead and minimizing memory use.

Second, running up to date versions of PHP so you get the newest performance enhancements.

And last, configuring the support infrastructure for maximum benefit, OPcache, and object cache.

Bonus: the better hosts will make individualized tuning changes for your site.

A Hardware Stack Optimized for WordPress

The hardware a host uses varies widely by host, and not all are transparent about how they configure resources, who their backbone provider is, etc. Generally, you want to separate resources, like site code, database, and backups. And there are benefits with database options, like data reliability and scaling.

The bottom line: there’s no reason why your host shouldn’t have protocols and tools in place to earn your trust as a fast provider. The examples listed here should help you get a sense of how your host stacks up. If they have a logical answer to each area, you can rest a little easier.

Bonus: Look for a host that utilizes Nginx for caching

NGINX is a fast, high-performance web server that accelerates content & application delivery, improves security, and facilitates availability and scalability for half of the world’s busiest sites.

It can also be utilized to cache pages and assets.

By placing Nginx in front of the traditional LAMP stack WordPress is installed upon, it’s utilized to cache pages and static assets for faster load times.

Combine that with Redis for object caching, and PressCDN for content caching around the globe, and you have a recipe for some of the fastest WordPress hosting available. Here’s an image showing how we default to Nginx cache node with Apache behind it serving PHP at Pagely, though you can also opt for Nginx only.

One Last Thing to Consider

While page speed is important, your goal should be to improve larger issues that substantially affect page speed, rather than trying to achieve the perfect benchmark score or shave 1 millisecond off of your load times.

In fact, you might even consider that 1 millisecond a vanity metric. Is that 1 millisecond really going to be noticeable to your users, or is it a metric you can throw into a report to make your team look good?

It’s clearly much more important to focus on systemic improvements that lead to measurable outcomes. The quality of your code and the capabilities of your hosting provider, and the tools they utilize is a great place to start for this.

Solve real problems and don’t chase perfection, in other words. And don’t sacrifice performance or data reliability for the sake of speed.

New Posts in your inbox