- JOOMUNITED NEWS -
WordPress Optimization: For Speed
Here’s the deal:
If your website takes more than 3 seconds to load…
… most of your visitors will leave and never come back.
If you want people to read your content and buy what you are selling, you will need to improve your website’s speed.
A faster-loading website means:
- More traffic from Google
- Lower bounce rate
- Better conversion rate
- More sales
But the problem is improving your website’s speed is hard and can take a lot of time. If you hire a web developer, it will cost you well over a thousand dollars. If you are a WordPress user, you can easily do it by using a plugin like WP Speed of Light.
In this guide, I will show you how you can improve the speed of your WordPress website with our plugin, WP Speed of Light.
Why You Need To Improve Your Website’s Speed
There are a lot of reasons why you would want to improve your website’s speed. One of the most important is to reduce your website’s bounce rate.
If your website takes more than 3 seconds to load, most people will leave right away. This increases your bounce rate, and in Google’s eyes, a website with a high bounce rate is a low-quality website. Moreover, Google’s algorithms prefer to display websites that load up fast, offer a great user experience and have a low bounce rate. So, if you want to get to the first page of Google and stay there, you need a fast website.
Not only that, if you want your website visitors to buy what you are selling or even subscribe to your email list, you will need a faster website. The slower your website loads, the lower your conversion rate will be. A faster website will increase your overall conversion rate which means more subscribers, more shares, and more sales.
Not only that, according to Kissmetrics, 47% of the consumers expect a web page to load in 2 seconds or less, and 40% of your users will abandon your website if it takes over 3 seconds to load. If you are still not convinced, according to WebsiteOptimization.com, a slow website is perceived low-quality, will decrease your traffic by up to 20% and will even raise the blood pressure of your users.
Serve Cached Pages To Reduce Loading Time and Server Resources
Every time someone visits a page on your website, WordPress goes through thousands of lines of code, connects to the database and then generates the page. Connecting to the database and running thousands of lines of code not only takes a lot of time but it also increases the load on your servers.
This is where caching comes in. When you enable caching, WordPress won’t regenerate the pages of your website every time they are requested. Instead, it will cache (make a copy) the contents of the page the first time it is generated and then serves this cached copy of the page to the users. By serving a cached copy of the page, WordPress bypasses the need to regenerate a page or even connecting to the database to get the content. This not only saves a lot of server resources, but it also reduces the time it takes to serve a page to the user.
Enabling caching in your WordPress installation can cut your website’s load time by almost half.
But here’s the problem:
WordPress by default doesn’t come with caching functionality. This means there is no button in the WordPress Dashboard you can click to enable caching. To enable caching on your WordPress site, you will need to install our plugin, WP Speed of Light. It is free and doesn’t take more than a second to install. Once you have it installed on your website, here’s how you can enable caching:
How to enable caching with WP Speed of Light
To enable caching with our plugin, log into your WordPress dashboard and then navigate to WP Speed of Light -> Speed Optimization:
Once on the speed optimization page, Enable the following options:
Activate Cache System: This will activate the main cache system. Once you enable this option, our plugin will cache database queries and common page elements.
Clean Each: This option dictates how often our plugin will clear the cache. Clearing cache from time to time is important. If you don’t clear your server’s cache, new changes to your website won’t reflect on your user’s end. We recommend keeping this option at 40 minutes.
Cleanup On Save: This is an option you will want to enable. It clears the cache as soon as you add or make changes to a post or a page. If you don’t clear your server’s cache after publishing a new page or making a change, your users won’t be able to see the new changes and the newly published pages.
Cache For Desktop: This option dictates whether or not our plugin serves the desktop users a cached page. You will want to enable this option.
Cache For Tablet: Keep it set to Automatic unless you are experiencing a wrong cache version being served to tablet users. This can happen only when your site serves different content (HTML) to different device users.
Cache For Mobile: This option is the same as the last one. We recommend that you keep it set to Automatic.
Never cache the following pages (optional): This option allows you to exclude certain pages that are dynamic and do not need to be cached. For this option, enter one URL per line which you don’t want to be cached. Most users don’t need this feature.
Once you have enabled all of these options, click save changes. That’s it. You just enabled caching on your website. From now on, your users will be served a cached copy of your site’s pages and posts.
Slash Your Website’s Load Time By More Than Half With GZIP
The best solution? Enable GZIP on your server.
GZIP is a compression algorithm that once enabled will reduce the size of your files by more than half. Once you enable GZIP, your website’s server will start serving compressed files to the browsers that support it. So, your images that might be over 5 megabytes will be compressed to less than 2 when served. This will not only reduce your bandwidth costs and server load, but it will slash your website’s load time by more than half.
How to enable GZIP with WP Speed of Light
Our plugin first checks if GZIP is already enabled on your server, which is now the case with most of the major web hosting providers. If it is already enabled on the server, our plugin doesn’t need to do anything. But if your server doesn’t have GZIP enabled, our plugin will enable it using the apache module (mod_deflate) or the Nginx module (ngx_http_gzip_module) by adding the required code to the htaccess file of your WordPress server.
If your server doesn’t have GZIP enabled by default and our plugin cannot do it with htaccess, it shows a warning notification in the plugin dashboard.
Leverage Browser Caching To Improve Your Website Speed
This not only increases your bandwidth costs and server load, but it will also increase your website’s load time.
This is where browser caching comes to rescue. By specifying an expiry time for the static files like images and css on your server, you instruct the browser there is no need to re-download them on every website visit.
Once you enable browser caching on your server, your website will load up faster from the second visit onwards because the user’s browser will not have to redownload all the files every time the user visits a different page on your website. Instead, the user’s browser will be able to generate them using the files it has already downloaded and cached.
How to enable browser caching on your server with WP Speed of Light
To leverage browser caching using our plugin, log into your WordPress Dashboard and navigate to WP Speed of Light -> Speed Optimization:
Now, on the Speed Optimization page, enable the “Add expire headers” option:
Once you enable this option, our plugin will instruct the user's browser to cache the static resources on and use them instead of requesting them again on every visit.
Remove Query Strings From Static Resources
Even after you enable browser caching, browsers treat files differently when they have a query string attached at the end of their URL.
Here’s what a query string looks like: http://your-site.com/style.css?query-string=123
To remove the query string from the URLs of your static resources, follow these steps:
How to automatically remove query strings with WP Speed of Light
To remove query strings from your static URLs, log into your WordPress Dashboard and navigate to WP Speed of Light -> Speed Optimization:
Now, on the Speed Optimization page, enable the “Remove query strings” option:
Once you enable this option, our plugin will automatically remove the query strings from all your URLs. This will make sure your users’ browser uses the client-side cache instead of redownloading a new copy of the static files on every visit. This will also result in a higher score in speed testing tools like GTMetrix and Google Page Speed Test.
WordPress is the most popular content management system on the internet. It is flexible and comes with literally thousands of features. But this flexibility comes at a cost. The cost is the slow loading speed of your website. WordPress, being highly customizable and flexible, has a large codebase, and this large codebase takes time to run. And when you install a new plugin, it adds, even more,lines of code to this large codebase making it even larger.
The more plugins you install and use on your website, the slower it will get. Luckily, if you use a plugin like WP Speed of Light and enable caching, your website will run smoothly and will load up fast. Not only that, you will also see an increase in conversion rate, higher search engine rankings and reduced bounce rate.
Have any questions or suggestions? Feel free to let us know in the comments below.