In the battle for customers’ attention, speed wins. Faster sites rank higher in search engines, lower in bounce rates, and generally outperform their more sluggish counterparts. If your website is essential to your business, it needs to be as speedy as possible.
Simply put: making WordPress faster matters. WordPress is capable of serving millions of pages at scale, but only if it’s properly configured and maintained. Here’s how to assess your site’s speed, identify problem areas, and max out your performance.
The Quickstart Guide to Fast WordPress
1. Test Your Site for Performance Issues
Before you start digging through settings and changing files, it’s important to get a baseline on your site’s current performance. Google has a trio of free tools that can provide useful insights:
Lighthouse runs in Chrome DevTools, and features multiple audits that generate reports and recommendations.
TestMySite specifically tests for mobile responsiveness. Since the majority of web traffic is on mobile, it’s vital to test that performance as well.
PageSpeed runs a battery of tests, simulating how your site loads on multiple types of devices.
These tests are great for a high-level indication of how your page performs compared to web standards. The reports they generate can be a useful tool to begin pinpointing and fixing problems.
You can further pinpoint the source of some performance problems with a monitoring tool like New Relic.
2. Fix Frontend Issues
The primary indicators for performance issues on the frontend are initial response time, “time to first byte,” and the time it takes to render content, “time to first paint.” If either of these metrics are slow, your site is likely to suffer in Google ranking and provide a negative experience for your users.
Evaluate the following elements of your page to give it a performance boost:
Hosting providers like Pantheon provide full-page caching, which stores a cached copy of the full HTML pages on your site to avoid having to render them with each user request. If your site doesn’t have a full-page cache, that’s the first step to improving performance.
If your site should be serving cached pages but requests are hitting the server instead, there are a few likely culprits. Pantheon’s guide to frontend performance has an in-depth walkthrough for eliminating cache busters.
Image files are a great place to start optimizing for performance, since the fixes are simple and straightforward. Think of two guiding principles: 1) Send only as many pixels as you need, and 2) Send only as many bytes as you need.
For the first principle, look for instances where you have high-resolution images that are never displayed at full resolution. If your product photos are in a 1024x768 window, for example, you don’t need a 5000x5000 pixel source file.
For the second principle, consider reducing file sizes by using Scalable Vector Graphics (.svg) for items like logos and icons. As text files, they can be much smaller than their binary counterparts. For large images, try the progressive JPG format which gives you the benefit of compression that comes with baseline JPEGs while also incrementally loading for a browsers on a slow connections.
Before you take that step, though, it’s important to audit scripts and eliminate unnecessary or redundant objects. Eliminating redundancy will make your minifying far more effective than if you optimize without clearing out the junk you don’t need.
3. Fix Server-Side Issues
Frontend performance is all about getting a client browser to understand your webpage as quickly as possible. Server-side performance looks at the processes that generate the webpage in the first place. New Relic is a useful tool for troubleshooting server-side issues, and a debugging plugin Debug Bar can help, too. The following three elements are likely culprits for server-side performance issues:
It’s simple to create a report of the longest-loading queries, but that data might not be the most useful for optimization. Queries that are complex by necessity will show up on the top of the list, but if they’re serving genuinely complex business requirements, they’re not a good candidate for optimization.
Look for queries that are complex but serve a simple purpose. See how simply you can describe the query in plain English, and let that description guide rewriting the way it executes. If the query results are likely to be static for long periods of time, consider caching the results. That way, your site doesn’t have to run the query every time the data is needed..
Even without analyzing any of your queries too closely you can benefit from an object cache. Plugins like wp-redis allow WordPress to load objects like posts and users from an object cache like Redis rather than going to MySQL to load them.
As with queries, you can start evaluating by generating a list of slow plugins, or just reducing the number of total plugins. But you will see better results by auditing for redundancy and quality, not quantity. The total number of plugins does correlate to sites being slow, but that’s likely due to redundancy, not just the overall number.
It’s best to audit your plugin list manually, checking:
What each plugin does
Why it’s there
Whether it’s still needed
Whether anything breaks if it's removed
Calling out to 3rd-Party APIs can slow down the rendering of your site’s HTML. For example, if you have a plugin that pulls data from Twitter to show recent tweets, your site speed is now dependent on Twitter’s performance.
If you have to pull in 3rd-party data, it’s best to schedule a cron job that fetches the data. Then cache the data locally to keep your performance independent of that 3rd-party source.
WordPress performance is a process, not a single task or checklist. A performance audit can set you on the right path to keeping your site lean and fast. But don’t make it the end of your performance journey. To take the next step, check out our Quickstart Guide to Fast WordPress.
The right WordPress host can make a big difference in performance. Pantheon is built for speed: Create a free account and see for yourself.
Developer’s Guide to Frontend Performance
Topics: WordPress Hosting, Speed & Performance, WordPress