Speed Matters Ebook WEB
Speed Matters Ebook WEB
Speed Matters:
25 Expert Tips for
an Ultrafast WordPress
Website
Table of Contents
Why does site speed matter? 4
Identify and Prioritize Site Speed Issues 6
Benchmark your site speed 7
Common website speed issues 9
Prioritizing issues 9
2
21. Clean up plugin options from your database 31
Conclusion 38
About the author 39
3
Why does site speed matter?
One of the most influential factors on your website’s success, customer
attention, conversion rates, and search engine rankings is website
performance, particularly website speed.
Let’s start!
Using the Speed Test feature of the plugin (based on Google PageSpeed), you can
easily check the optimization level of your site in over 20 different areas. Furthermore,
suggestions are linked to the exact options in the plugin interface that can improve
the metrics that aren’t perfect.
Next, you can select a device type (Desktop or Mobile) and type the slug of the URL
you want to test or leave the designated field empty to test the entire site’s speed.
GTmetrix
GTmetrix is a useful performance tool that combines its own tests
with Google core vital checks. It provides useful information about
the way your site loads, gives you useful tips for hands-on actions
you can take and the waterflow view shows you potential problematic
resources that slow down your site.
There are many other performance tools available, and if you notice poor results, it is
always a good idea to test your website with them. The more tests you perform, the
better. Thus, you’ll be able to put all the performance reports together, compare them,
and get a clear picture of how your website is actually performing.
Pro Tip: Even though most of the benchmarking tools will give you a “grade”, don’t go
too far chasing it. If your website loads in under two seconds, you’ve done the biggest
part of the job. Chase milliseconds and not artificial grades!
Although each website is unique and has its own set of speed issues, the following
are quite common and should be addressed first:
Prioritizing issues
Your research and analysis of the causes of slowness may result in a
very long list of things you could do. However, you need to prioritize
that list. Some of these issues may take time to fix and may not result
in significant improvements in speed. There are two things that you
should consider when prioritizing your fixes:
Use the answers to these questions in order to create a list of optimizations starting
from those that will have the most significant impact on the time spent.
● HTTPS option - securing your website with an SSL certificate is a must nowadays,
as it helps you establish brand trust. Moreover, when a site loads over HTTPS,
it uses HTTP/2 which is much faster than HTTP. SiteGround customers can
configure their site to work with https:// using two separate options. They can
enable the Enforce HTTPS feature for a website from their Site Tools.
● Content Delivery Network (CDN) - visitors around the world should be able to
access your site at all times without location-driven delays. This is extra impor-
tant for websites with an international audience. A CDN caches your website and
distributes it on servers that are closer to your visitors.
Our in-house CDN solution is easy-to-use and does not require any complex
configurations to enable it for your site. You can activate it with as much as a click
and it starts serving your site from the closest available point to your visitors.
SiteGround CDN network is powered by 14 locations all over the world.
To activate SiteGround CDN for your website, navigate to the respective Site
Tools > Speed > CDN.
When the service is active, you can manage various CDN settings. Make your site
blazingly-fast with SiteGround CDN.
At SiteGround we have our own Ultrafast PHP which ensures faster page response,
increased server capacity, lower server memory usage and overall performance
improvement.
● Optimized MySQL Processing - heavy MySQL queries slow down your website
and have a negative impact on user experience. At SiteGround to overcome this
challenge, we deployed a new server-wide solution to optimize MySQL queries.
This innovation significantly reduces the amount of slow MySQL queries which
are taxing on server resources and site performance.
Some key factors to consider when choosing a home for your website are:
● Fast connectivity and low latency - а suitable server offers high availability,
low latency and reliability. Customers expect to interact with the web in real
time, without delays. Thus, ensure that the server you choose can meet these
requirements.
At SiteGround, we’ve ensured these points with our main datacenter partner
Google, which is known for maintaining a fast and powerful network.
● You can test your site’s TTFB with the Speed Test feature, provided by the
SiteGround Optimizer plugin.
● Check the Geolocation of your visitors - The physical location of your website can
affect its speed performance and latency. Checking where your visitors are from
will help you figure out which datacenter is closer to your audience and choose
it as the host for your website.
SiteGround’s data centers are on four different continents, so you can select the
one that is closest to your target audience.
Then, change the “Blog pages show at most” value to a lower number.
In case you’re displaying the blogroll on your home page, you can implement an infinite
scroll plugin like WordPress Infinite Scroll – Ajax Load More for example.
It will render more posts on demand rather than loading them all together during the
initial rendering process for your site.
This will split one big and slow page into several faster ones.
However, if you really need and want a slider, We recommend using Soliloquy. It comes
in a free and a premium professional version, which includes more features. This plugin
renders a fast and lightweight slider that has everything most people would need from
a slider plugin. Another good solution is the Meta Slider plugin - which is another free
and well-written extension.
Last but not least, consider replacing sliders with static images altogether. Latest
research show that moving big pieces of content tend to distract the user and they
will rarely see anything past the second slide.
If an image’s dimensions are larger than needed, they may take longer to load since
WordPress would have to change the dimensions of the image to fit it. This adds more
time for an image to be fully loaded and displayed. Same goes for images with larger
width and height.
A great plugin you can use to optimize your images is the FREE SiteGround Optimizer
plugin, created for top WordPress performance on our hosting environment. You can
have either lossless or lossy optimization depending on your needs. Furthermore,
you can easily generate WebP copies of your images that the SiteGround servers
will automatically serve if the browser supports the new format. WebP is a next-gen
imaging format already supported by all modern web browsers which provides much
better compressions without compromising with quality, resulting in stunning images
loading blazing fast.
Bear in mind that if you have multiple images on your site, optimizing all of them may
take a lot of time and hosting resources. Image optimization is important, however
lowering the size of your images without damaging their quality and removing all the
unnecessary data that your camera saves when you take a photograph (e.g. GPS
location of the photo, make and model of the camera used) adds to the overall perfor-
mance of your site.
Even if the image file is reduced by just a few KBs, when you combine all the images
on one page, the performance gain is usually significant.
Check your website and include only the font variation that you’re
actually using. In the SiteGround Optimizer plugin, we’ve developed a method to load
fonts asynchronously and cache them on your visitors’ browsers so you can achieve
the design you want without sacrificing speed.
To address similar issues on your website, use our SiteGround Optimizer. The plugin
allows you to perform Web fonts Optimization and enable Fonts Preloading from the
Frontend optimization section.
A way to manage that is by tweaking your WordPress Discussion Settings from the
Dashboard. To do that go to Settings > Discussion and check the box next to “Break
comments into pages with top level comments per page and the page displayed by
default”.
The “Break comments into pages with top level comments per page and the page
displayed by default” option allows you to set the number of comments that will appear
under a post. In case there are more comments to post than the designated number,
WordPress will split them into comment pages.
Brotli is a next-generation compression method that works the same way as Gzip.It
is developed by Google and uses better compression algorithms resulting in a much
smaller size of the transferred data - approximately 20% less than Gzip and 400%
smaller than uncompressed content! On SiteGround servers, we compress the content
with Brotli if your browser supports it automatically and fall back to Gzip if it doesn’t,
so you don’t need to do anything to get these improvements!
If you are not hosted with SiteGround, you should ask your provider about the available
compression methods and what’s the best way to enable them since different providers
use different tools for that.
GZIP/BROTLI COMPRESSION
GZIP
Decompress
&view
Combination on the other hand, combines multiple JavaScript and CSS files into one.
This reduces the number of requests your site makes.
SiteGround customers can use the SiteGround Optimizer plugin which will do both
optimizations for you with a single click. If not, there are a few plugins that do this really
well.
The browser parses the HTML markup of a page before it can render it. During this
process, if the browser encounters a script (like JavaScript), it must execute it to proceed
to parse the HTML. If there are externally-loaded scripts, the browser is forced to wait
for the resource to download, which may require more network roundtrips. Eventually,
this causes delays in the first render of a page.
To address this, you can take advantage of the Defer Render-Blocking JavaScript
feature of the SiteGround Optimizer’s Frontend > JavaScript optimizations.
The easiest way to cache your site is through a plugin. This saves the cached content on
the server’s hard disk and significantly improves site performance since your content
won’t be dynamically loaded every time. You can give the SiteGround Optimizer plugin
a try if you don’t have a hosting-powered solution at your disposal.
Later in the book, we talk about caching as a part of the services your hosting provider
can offer. When caching is enabled at the server level, the content gets saved not on
the hard disk, but in the server RAM. This makes the site performance gains much
greater since reading from the memory is faster than reading from the disc.
Every element of your WordPress theme affects the overall performance of your
website. Taking the time upfront to investigate the themes and their provider can save
a lot of trouble and work later on.
Read reviews for the themes, try getting some actual feedback from users, and check
whether the company is trusted in the WordPress community. You can also check our
blog post on Best WordPress Themes and see if any of the themes discussed suit your
needs. Don’t trust a theme provided by an unknown designer that does not respond
to his/her customers.
It’s important to have a well-written theme because the quality of the theme code
affects every part of your site. For example, some themes have a plugin functionality
and added features such as related posts under your normal posts. Such functionality
often causes slow loading times because of the way queries to the MySQL database
are structured. In short, you don’t have to be a good developer to have a good site, but
make sure your theme is written by a good one.
SiteGround customers can use the SiteGround Central plugin to pick from a variety
of free, well-written themes.
Thus, look for a quality coded forthright theme that has a reasonable size. Additionally,
your theme should be compatible with various caching and minification plugins or
include performance improvement options.
Functionalities such as carousels and sliders should not be part of your theme. You
can always add them using a plugin later on when you want them to be loaded.
You should also avoid themes with Page-builders, since that may prevent you from
easily changing it in the future, causing a lock-in issue. A theme-lock is when a user
is forced to continue using a theme, just because switching to a new one can elicit
data loss. The theme may be heavy and not well optimized, but still, you’ll be taught
to stick with it.
So, pick a theme that has the main functionality you need without tons of additional
features.
Usually, when people browse your page on their mobile phone, they are on 4G (LTE),
which is generally a slower connection than the one they have at home. That’s why it’s
good practice to show only what users need to see on mobile, rather than a shrunken
version of your pages. Here are a few steps for optimizing your mobile site:
Step 1. Test your pages with the Google Mobile-Friendly Test which will give you
information if a certain part of your page is not well-optimized for mobile.
Step 2. Always select a theme that’s either mobile-first or has a native mobile version.
When you run tests for your website, make sure you test the mobile version as well.
Step 3. If your theme doesn’t have a mobile version, consider using a plugin such as
WP Touch that will generate a mobile version of your page. However, having a native
mobile version is always preferable.
For example, if you’re using the Yoast SEO plugin and you want to
have a Google XML Sitemap, just enable this functionality in the plugin settings page
instead of adding another plugin, even though there are dozens available in the plugin
repository.
Plugins with overlapping functionalities can cause various conflicts, errors, website
misbehavior, or poorly functioning plugin features. Multiple plugins with the same
purpose slow down your website and can lead to data fragmentation.
Thus, you must choose your plugins wisely and be careful not to go overboard with
too many of them.
In addition, there are new features, functions, etc. constantly being introduced with
WordPress core updates. A lot of them are designed to allow plugins to operate better
and faster. By keeping your plugins updated, you will get all the performance improve-
Keeping your plugins up-to-date will allow you to use more recent PHP versions, which
gives your site a huge performance boost.
If you’re not using a plugin, delete it. There is no need to keep them on your website.
It’s good security practice and one less thing to slow down your back-end.
Most plugins don’t bother cleaning your database after you’ve uninstalled them. They
delete the plugin files, but the tables with different settings they’ve been utilizing
remain. When activated the Scheduled Database Maintenance feature removes all
unnecessary items from your database and optimizes its tables on a regular basis.
It clears post revisions, trashed posts, pages and comments, comments marked as
spam and expired transients.
SiteGround customers can use the Optimizer to enhance the way Dynamic caching
operates for their website. Along with Dynamic caching being enabled, our customers
can take advantage of the File-based Caching feature of the plugin for optimal perfor-
mance results. Moreover, the plugin allows you to enable object caching (Memcached)
as long as the feature is enabled in your Site Tools too. Combining the caching layers
on the server and the plugin can boost your site’s performance up to 5 times.
It saves the outcome of all PHP operations, database queries and more in the server
RAM and then when another visitor opens the same page, it serves the content from
the memory without even reaching the web server. You can easily enable server-level
Depending on the website, your loading time can go from 2-3 seconds to 0.5 seconds!
Furthermore, using a caching service like this will increase the amount of traffic you
can handle on your account. A test with a default WordPress installation on the same
SiteGround hosting account shows amazing results:
WITHOUT WITH
DYNAMIC DYNAMIC
CACHING CACHING
Needless to say, that’s a huge spike in traffic that’s handled without problems mostly
because of the caching system running on the server.
For websites with big databases, you can also implement object caching like
Memcached or Redis. These are services that your hosting provider must install on
their server and provide you with the ability to use them with your application. For
example, at SiteGround we provide Memcached as part of our WordPress performance
services that can be activated with a single click.
MULTIPLEXING
example.css example.css
image.png image.png
3 TCP CONNECTIONS
example.css example.css
image.png image.png
1 TCP CONNECTION
The HTTP/2 protocol is much faster and allows the browser to make multiple simul-
taneous requests for resources to the server, which results in faster and safer sites.
If you’re worried about the cost of an SSL certificate, there is a free solution called Let’s
Encrypt. With it, you can maintain the security of your websites without compromising
on speed. Learn more.
Hristo Pandjarov
Hristo has been working at SiteGround for more than fifteen years
now. He’s done it all. He’s supported WordPress clients, built websites,
designed themes, written eBooks, and led the organization of Word-
Camp Sofia twice! As SiteGround’s WordPress Innovations Director,
he spends his days developing and implementing various in-house
performance-boosting solutions to help make WordPress websites
faster and more secure.