Blazing Fast Cloud Servers

Server set-up in less than 1 minute, Instant scaling up or down as required, 99.95% uptime guaranteed, No hardware maintenance, Simple backup and monitoring, Unbeatable pricing.

Visit Website

How To Speed Up WordPress With Redis Full-Page Cache + Cloudflare (Divi Theme Get 100% GTmetrix Scores)

Speed up WordPress

This tutorial shows you how to set up Redis Full-Page Cache and Cloudflare CDN, make your WordPress site load fast, also get 100% GTmetrix scores.
Demo domain: blogwp.ovh
Demo Theme: Divi Theme
The VPS used in this article: Vultr (1GB RAM, 1 vCore)
Please add your domain name to Cloudflare in advance.
Please resolve your domain name to an IP address in advance.
Please replace blogwp.ovh with your own domain name.
Redis Full-Page Cache is NGINX server-side page caching. You will need a VPS / Dedicated server to use Redis Full-Page Cache. When using regular shared hosting, Redis Full-Page Cache is not available. With proper setup, server-side page caching can perform better than any WordPress cache plugin.
You can use WordOps to install Redis Full-Page Cache.

https://blogelegant.com/ build with Hostwinds KVM VPS and Nginx FastCGI Cache.
Affiliate Disclosure: This page contains affiliate links. If you click through and purchase an item, I may earn a commission.

You can read this article for a detailed installation of WordOps

How To Install WordPress with WordOps (Enable Nginx FastCGI Cache)
This tutorial shows you how to install WordPress with WordOps (Enable Nginx FastCGI Cache)

Method 1: Install Redis Full-Page Cache in WordOps
1、Install WordOps

wget -qO wo wops.cc && sudo bash wo
[email protected]:~# 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, it stands for your WordPress admin user name
Please replace [email protected] with your own email

2、Install WordPress + Redis Full-Page Cache + PHP 7.4

wo site create blogwp.ovh --wpredis --php74

When you use the flag –wpredis, WordOps will install redis and configure Nginx to use redis full-page cache. Additionally, it will also install Nginx Helper and Redis Object Cache plugin. The Redis Object Cache plugin lets Redis handle WordPress object cache. But if you remove Redis Object Cache plugin and only use Nginx Helper plugin, your site will only use redis full-page cache.

[email protected]:~# wo site create blogwp.ovh --wpredis --php74
Start : wo-kernel [OK]
Adding repository for MySQL, please wait...
Adding repository for NGINX, please wait...
Adding repository for PHP, please wait...
Adding repository for Redis, 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.4-fpm
Restarting php7.4-fpm           [OK]
Tuning MySQL configuration      [OK]
Restarting mysql                [OK]
Tuning Redis configuration      [OK]
Restarting redis-server         [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]
Setting plugin nginx-helper     [OK]
Installing plugin redis-cache   [OK]
Testing Nginx configuration     [OK]
Reloading Nginx                 [OK]
HTTP Auth User Name: WordOps
HTTP Auth Password : b0QsZTtp5jVtln19BHDQv3bB
WordOps backend is available on https://107.191.45.165:22222 or https://vultr.guest:22222
WordPress admin user : blogwpwpblog
WordPress admin password : plLadxSyUGJkD1vHghwE8WsA
Configure redis-cache:  http://blogwp.ovh/wp-admin/options-general.php?page=redis-cache
Object Cache:           Enable
Successfully created site http://blogwp.ovh

You need “Nginx Helper” plugin to automatically clear the Redis Full-Page Cache.
Nginx Helper Plugin Settings ( When You use WordOps )
The “Caching Method” should be set to “Redis cache”.

Note: “Nginx Helper” plugin support for purging redis full-page cache and FastCGI Cache. “Nginx Helper” plugin does not support for purging Redis Object Cache.

Method 2: Install Redis Full-Page Cache in WordOps with Redis Page Cache plugin
1、Install WordOps

wget -qO wo wops.cc && sudo bash wo
[email protected]:~# 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, it stands for your WordPress admin user name
Please replace [email protected] with your own email

2、Install WordPress

wo site create blogwp.ovh --wp
[email protected]:~# wo site create 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 : 4Tj2p76tFVUtxDYSm4Yk4TlD
WordOps backend is available on https://107.191.45.165:22222 or https://vultr.guest:22222
WordPress admin user : blogwpwpblog
WordPress admin password : mp2bONrGPvBJ1YgManZhcWuA
Successfully created site http://blogwp.ovh

3、Install Redis (Redis server and the Redis PECL extension)

wo stack install --redis
[email protected]:~# 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

Visit https://blogwp.ovh/wp-admin, remove all plugins that are installed by default.

4、Install Redis Page Cache plugin


After installing and activating the WordPress plugin, you’ll need to create a symbolic link to the advanced-cache.php dropin:

cd /var/www/blogwp.ovh/htdocs/wp-content
ln -s plugins/pj-page-cache-red/advanced-cache.php advanced-cache.php

5、Finally, enable page caching in WordPress with a constant in wp-config.php:

define('WP_CACHE', true);

wp-config.php file location (when use WordOps): /var/www/blogwp.ovh/wp-config.php
More information: https://github.com/pressjitsu/pj-page-cache-red/

Install Divi Theme, under the Theme Options, enable Minify And Combine Javascript Files, enable Minify And Combine CSS Files, enable Static CSS File Generation.

When you use Cloudflare CDN, by default it only cache the static files like images, CSS, JavaScript etc, it doesn’t cache HTML pages. If you want to make your site faster, you need to use Cloudflare page rule feature to cache HTML pages.
Cloudflare CDN Settings:
Because blogwp.ovh is a demo site, I didn’t install Let’s Encrypt’s SSL certificates. So when you use Cloudflare SSL, then the SSL/TLS encryption mode should be set to “Flexible”


Click the ‘SSL/TLS’ section, click the Edge Certificates tab, toggle the Always Use HTTPS switch to On.


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.


The following steps are the most important part: Set up cache everything page rule in Cloudflare, this can greatly speed up your WordPress website.

Note: Set up cache everything page rule can cause several problems, such as the WordPress admin bar will show if the user is logged in. The new comments will not be visible unless you clear the cache. The comment area will caches the WordPress login user name like the image shows. But don’t worry, the next step is to show you how to solve these problems.


Method:
First of all, make sure the ‘Browser Cache TTL’ in the ‘Caching’ section is set to ‘Respect Existing Headers’.

Then install WP Cloudflare Super Page Cache plugin. WP Cloudflare Super Page Cache plugin allows you to bypass the cache for logged in users even on free plan, this means that WP admin bar will not be cached. It can also automatically clean up the cache on website changes.


WP Cloudflare Super Page Cache Plugin Settings:
1. Enter your Cloudflare’s API key and e-mail


2. Select from the dropdown menu the domain for which you want to enable the cache


3. Enable Page Caching


4. Test Cache


When the settings are complete, WP Cloudflare Super Page Cache Plugin will automatically adds a cache everything page rule under Page Rules section.


When you correctly set up WP Cloudflare Super Page Cache plugin, the above annoying problems will be solved.

More methods

How to use CloudFlare Cache Everything Page Rules to Reduce Cloudflare TTFB and Speed Up WordPress Site | blogelegant.com

How to verify that everything is working properly?
Check the HTTP response headers of the displayed page in Incognito mode (browse in private). WP Cloudflare Super Page Cache returns two headers:
x-wp-cf-super-cache
If its value is cache, WP Cloudflare Super Page Cache is active on the displayed page and the page cache is enabled. If no-cache, WP Cloudflare Super Page Cache is active but the page cache is disabled for the displayed page.
x-wp-cf-super-cache-active
This header is present only if the previous header has the value cache.
If its value is 1, the displayed page should have been placed in the Cloudflare cache.
To find out if the page is returned from the cache, Cloudflare sets its header called cf-cache-status.
If its value is HIT, the page has been returned from cache.
If MISS, the page was not found in cache. Refresh the page.
If BYPASS, the page was excluded from WP Cloudflare Super Page Cache.
If EXPIRED, the page was cached but the cache has expired.
More information: https://wordpress.org/plugins/wp-cloudflare-page-cache/

Load Test before install Redis Full-Page Cache (tool: https://loader.io/)

Load Test after install Redis Full-Page Cache (tool: https://loader.io/)

Load Test after install Redis Full-Page Cache + CloudFlare Cache Everything Page Rules (tool: https://loader.io/)

I use KeyCDN’s performance tool to measure the TTFB

The TTFB before settings

The TTFB after settings

Speed Tests Results
GTmetrix:

The speed optimization method can be summarized as: Redis Full-Page Cache + Nginx Helper / Redis Page Cache Plugin + WP Cloudflare Super Page Cache + Cloudflare CDN

If you have any questions, please leave me a comment.

Copied title and URL