This tutorial shows you how to speed up WordPress with W3 Total Cache + Cloudflare CDN. W3 Total Cache is a free WordPress caching plugin, it’s not easy to use compared to WP Super Cache and Cache Enabler, but if you prefer to use W3 Total Cache plugin, this post may help you.
The VPS used in this article: DigitalOcean (1GB RAM, 1 vCore)
Get $100 of free DigitalOcean credits if you sign up through this link!
LEMP stack used in this article: WordOps
Note: WordOps has provided the best combination of Nginx FastCGI Cache + Redis Object Cache, this article is only used to test the performance of W3 Total Cache.

Operating System: Ubuntu 20.04
Please add your domain name to Cloudflare in advance.
Please resolve your domain name to an IP address in advance.
Demo domain: 8.blogwp.ovh
Please replace 8.blogwp.ovh with your own domain name.
You can read this article for a detailed installation of WordOps

1、Install WordOps
wget -qO wo wops.cc && sudo bash wo
root@ubuntu-s-1vcpu-1gb-nyc1-01:~# wget -qO wo wops.cc && sudo bash wo
Welcome to WordOps install/update script v3.13.2
Installing wo dependencies [OK]
Installing WordOps [OK]
Running post-install steps [OK]
WordOps (wo) require an username & and an email address to configure Git (used to save server configurations)
Your informations will ONLY be stored locally
Enter your name: blogwpwpblog
Enter your email: [email protected]
Synchronizing wo database, please wait...
WordOps (wo) installed successfully
To enable bash-completion, just use the command:
bash -l
To install WordOps recommended stacks, you can use the command:
wo stack install
To create a first WordPress site, you can use the command:
wo site create site.tld --wp
WordOps Documentation : https://docs.wordops.net
WordOps Community Forum : https://community.wordops.net
WordOps Community Chat : https://chat.wordops.net
Give WordOps a GitHub star : https://github.com/WordOps/WordOps/
Note:
Please replace blogwpwpblog with your own name
Please replace [email protected] with your own email
2、Install WordPress
wo site create 8.blogwp.ovh --wp
root@ubuntu-s-1vcpu-1gb-nyc1-01:~# wo site create 8.blogwp.ovh --wp
Start : wo-kernel [OK]
Adding repository for MySQL, please wait...
Adding repository for NGINX, please wait...
Adding repository for PHP, please wait...
Updating apt-cache [OK]
Installing APT packages [OK]
Applying Nginx configuration templates
Testing Nginx configuration [OK]
Restarting Nginx [OK]
Testing Nginx configuration [OK]
Restarting Nginx [OK]
Configuring php7.3-fpm
Restarting php7.3-fpm [OK]
Tuning MySQL configuration [OK]
Restarting mysql [OK]
Running pre-update checks [OK]
Setting up NGINX configuration [Done]
Setting up webroot [Done]
Downloading WordPress [Done]
Setting up database [Done]
Configuring WordPress [OK]
Installing WordPress [OK]
Installing plugin nginx-helper [OK]
Testing Nginx configuration [OK]
Reloading Nginx [OK]
HTTP Auth User Name: WordOps
HTTP Auth Password : 9MVINGhSt8RscLG2cMUZ5VoB
WordOps backend is available on https://64.227.1.210:22222 or https://ubuntu-s-1vcpu-1gb-nyc1-01:22222
WordPress admin user : blogwpwpblog
WordPress admin password : 86J4IjzVSXi0Ubp1gf5moZNu
Successfully created site http://8.blogwp.ovh
3、Install Redis
wo stack install --redis
root@ubuntu-s-1vcpu-1gb-nyc1-01:~# wo stack install --redis
Adding repository for Redis, please wait...
Updating apt-cache [OK]
Installing APT packages [OK]
Tuning Redis configuration [OK]
Restarting redis-server [OK]
Successfully installed packages
4、Install W3 Total Cache plugin
Click W3 Total Cache “Performance” option, you will see “nginx.conf rules have been updated. Please restart nginx server to provide a consistent user experience.”
When you use WordOps LEMP stack, the nginx.conf file located at /var/www/8.blogwp.ovh/htdocs
The contents of the nginx.conf file
Execute the following command to restart nginx
wo stack restart --nginx
root@ubuntu-s-1vcpu-1gb-nyc1-01:~# wo stack restart --nginx
Testing Nginx configuration [OK]
Restarting Nginx [OK]
W3 Total Cache plugin settings
Click “General Settings”
Check “Enable” Page Cache, choose “Redis” Page Cache Method from the drop down menu.
Uncheck “Enable” Minify, instead use Cloudflare “Auto Minify” feature. If you enable W3 Total Cache Minify and Cloudflare Auto Minify at the same time, you may have unexpected effects on your sites.
Choose “Opcode: Zend Opcache” from the drop down menu.
Uncheck “Enable” Database Cache if you use Object Cache.
Check “Enable” Object Cache, choose “Redis” Object Cache Method from the drop down menu.
Check “Enable” Browser Cache
Uncheck “Enable” CDN, instead use Cloudflare CDN.
Check “Lazy Load Images”, check “Disable Emoji”, check “Disable wp-embed script”, check “Disable jquery-migrate on the front-end”
Do not use Fragment Cache
Uncheck “Enable Google Page Speed dashboard widget”
Click “Save all settings” button.
5、Cloudflare CDN Settings
Click the ‘Speed’ section, click the Optimization tab, turn Auto Minify on, toggle the Brotli switch to On.
Click the ‘Caching’ section, click the Configuration tab. Under Browser Cache TTL section, set the option to Respect Existing Headers.
Click the ‘Network’ section, toggle the HTTP/3 (with QUIC) switch to On, toggle the 0-RTT Connection Resumption switch to On, toggle the gRPC switch to On, toggle the WebSockets switch to On.
6、W3 Total Cache Load Testing
Load Testing Tool: loader.io
Load Testing Type: Clients per second and Maintain client load
Twenty Twenty-One theme
Use “FakerPress” plugin to generate 300 posts and 1500 comments.
6.1 Download the verification file
6.2 Upload the verification file. When use WordOps, the verification file of loader.io need to be uploaded to /var/www/8.blogwp.ovh/htdocs
6.3 Click “Verify” button, shows “Congrats, target verification passed!”
Please refer to this article for the verification process of loader.io

Load Test after enable W3 Total Cache
250 clients per second in 1 minute, the average response time is 18 ms.
500 clients per second in 1 minute, the average response time is 19 ms.
750 clients per second in 1 minute, the average response time is 1155 ms.
1000 clients per second in 1 minute, the average response time is 2335 ms.
1250 clients per second in 1 minute, the average response time is 3213 ms.
1500 clients per second in 1 minute, the average response time is 3844 ms.
1750 clients per second in 1 minute, the average response time is 4587 ms.
2000 clients per second in 1 minute, the average response time is 5311 ms.
2500 clients per second in 1 minute, the average response time is 6727 ms.
3500 clients per second in 1 minute, the test was aborted because it reached the error threshold.
Load Test (Maintain client load) after enable W3 Total Cache
From 0 to 250 clients in 1 minute, the average response time is 197 ms.
From 0 to 500 clients in 1 minute, the average response time is 389 ms.
From 0 to 750 clients in 1 minute, the average response time is 563 ms.
From 0 to 1000 clients in 1 minute, the average response time is 727 ms.
From 0 to 1250 clients in 1 minute, the average response time is 903 ms.
From 0 to 1500 clients in 1 minute, the average response time is 1090 ms.
From 0 to 1750 clients in 1 minute, the average response time is 1235 ms.
From 0 to 2000 clients in 1 minute, the average response time is 1362 ms.
From 0 to 2500 clients in 1 minute, the average response time is 1046 ms.
From 0 to 3500 clients in 1 minute, the average response time is 2228 ms.
From 0 to 4500 clients in 1 minute, the average response time is 2645 ms.
From 0 to 5500 clients in 1 minute, the average response time is 2392 ms.
From 0 to 6500 clients in 1 minute, the test was aborted because it reached the error threshold.
Note:Depending on the blog environment (plugins and various settings ), the load testing results will vary.
Speed Tests Results
GTmetrix:
PageSpeed Insights:
The speed optimization method can be summarized as: W3 Total Cache + Cloudflare CDN
If you have any questions, please leave me a comment.