This is a series of articles explaining how to speed up WordPress, the use of which is growing rapidly for CMS-based business sites and media sites. In part 4, I will continue to explain how to speed up WordPress by 540% just by using the standard CentOS environment. --Kengyu Nakamura, Prime Strategy Co., Ltd.
In the previous article , we installed the PHP accelerator OPCache, edited parameters for MariaDB, and installed a translation accelerator to get WordPress 480% faster.
In this article we will continue to push that to 540%.
Reduce transmission time with gzip compression
First, we will use Apache settings to shorten transmission time.
gzip can compress a text file to 1/4th its original size. With it you will not only increase speed but also save on bandwidth.
We will also configure settings to strengthen the browser cache and control the HTTP response header Expire field and Cache-Control field. For our purposes we will set the MIME Type text/html to 10 seconds and all others to 600 seconds.
Add the following code to the end of “/etc/httpd/conf/httpd.conf”:
Restart Apache for the changes to take effect.
[root@ip plugins]# systemctl restart httpd
However, if you refresh the front page by clicking links in your site rather than using F5, you will see that the browser cache is working according to our Expire settings.
More optimization with Tuned settings
Let’s configure Tuned and get even more speed.
Tuned is a daemon that optimizes system settings based on the status of the OS. There are many profiles to choose from, so it is important to choose the most appropriate one to boost your OS performance.
Using the “tuned-adm list” command, you can see the available profiles and the currently assigned profile.
[root@ip plugins]# tuned-adm list Available profiles: - balanced - desktop - latency-performance - network-latency - network-throughput - powersave - throughput-performance - virtual-guest - virtual-host Current active profile: virtual-guest
As you can see above, the profile is set to virtual-guest. We want to change this to throughput-performance, which increases disc and network I/O.
[root@ip plugins]# tuned-adm profile throughput-performance
In my environment, page load time was 34ms and requests per second was 58.47, several percent better performance.
|Tuning contents||Page load time||Requests per second|
|Tuned settings||34ms (517%)||58.47|