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 Nginx FastCGI Cache + Cloudflare CDN (Divi Theme Get 100% GTmetrix Scores)

Speed up WordPress

This tutorial shows you how to set up Nginx FastCGI Cache and Cloudflare CDN, make your WordPress site load fast, also get 100% GTmetrix scores.
The VPS used in this article: Vultr (1GB RAM, 1 vCore)
Get $100 of free Vultr credits if you sign up through this link!
Demo domain: blogwp.ovh
Demo Theme: Divi Theme
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.

Nginx FastCGI Cache is NGINX server-side page caching. You will need a VPS / Dedicated server to use Nginx FastCGI Cache. When using regular shared hosting, Nginx FastCGI Cache is not available. With the correct settings, the performance of server-side page caching can be better than any WordPress caching plugin.
You can use WordOps or Webinoly to install Nginx FastCGI 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.
Nginx FastCGI Cache Vs Nginx FastCGI Cache + Redis Object Cache Vs Redis Full-Page Cache Vs LiteSpeed Cache
This article shows you page caching performance comparation: Nginx FastCGI Cache Vs Nginx FastCGI Cache + Redis Object Cache Vs Redis Full-Page Cache Vs LiteSpeed Cache

You can read these 2 articles for a detailed installation of WordOps and Webinoly

How To Install WordPress with WordOps (Enable Nginx FastCGI Cache)
This tutorial shows you how to install WordPress with WordOps (Enable Nginx FastCGI Cache)
How To Install WordPress with Webinoly (Enable Nginx FastCGI Cache)
This tutorial shows you how to install WordPress with Webinoly (Enable Nginx FastCGI Cache)
Install Nginx FastCGI 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 + Nginx FastCGI Cache

wo site create blogwp.ovh --wpfc
[email protected]:~# wo site create blogwp.ovh --wpfc
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]
Setting plugin nginx-helper     [OK]
Testing Nginx configuration     [OK]
Reloading Nginx                 [OK]
HTTP Auth User Name: WordOps
HTTP Auth Password : brWdjM1HRnBhGM2uPJc33wxV
WordOps backend is available on https://149.28.254.29:22222 or https://vultr.guest:22222
WordPress admin user : blogwpwpblog
WordPress admin password : B8dte6ojQArDSxFP32qKmVh9
Nginx-Helper configuration :    http://blogwp.ovh/wp-admin/options-general.php?page=nginx
Successfully created site http://blogwp.ovh
Install Nginx FastCGI Cache in Webinoly

1、Install LEMP Stack

wget -qO weby qrok.es/wy && sudo bash weby 3
MySQL has been installed successfully!
phpMyAdmin has been installed successfully!


****************************************************************************
******            INSTALLATION HAS FINISHED SUCCESSFULLY              ******
****************************************************************************
********      Save your DB access password in a secure place:       ********
******      root: w6l1BJCieRakZZEy       admin: RdUqVdLiH8B5pcuc      ******
****************************************************************************

2、Install WordPress, Enable Nginx FastCGI Cache

sudo site blogwp.ovh -wp -cache=on
[email protected]:~# sudo site blogwp.ovh -wp -cache=on

Downloading WordPress...


[WARNING] HTTP Authentication Credentials not found and you may need it to complete the WordPress installation process!!
[WARNING] Login for www-data is not enabled and you may need it to upload your site files!

 Nginx Helper Plugin has been installed!
 Please, activate this plugin for a better experience with FastCgi Cache.
 ** IMPORTANT - Plugin Settings **
- The “Caching Method” should be set to “Nginx FastCgi Cache”.
- Support for purge/url method is a premium feature only included in NGINX Plus (not-free) and we recommend not to trust in solutions or tools that use third-party NGINX modules to offer this feature.
- The Purge Method should be set to “Delete local server cache file”.


 Redis Object Cache Plugin has been installed!
 Please, activate this plugin for a better experience with WordPress Object Cache.
 ** IMPORTANT - Plugin Settings **
- Go to “Menu > Settings > Redis” and be sure that Object Cache is enabled.

WordPress Cache successfully enabled!
Site blogwp.ovh has been successfully created!

You need “Nginx Helper” plugin to automatically clear the Nginx FastCGI Cache.
Nginx Helper Plugin Settings ( When You use WordOps )
The “Caching Method” should be set to “Nginx FastCgi Cache”.
The Purge Method should be set to “Using a GET request to PURGE/url”.

Nginx Helper Plugin Settings ( When You use Webinoly )
The “Caching Method” should be set to “Nginx FastCgi Cache”.
The Purge Method should be set to “Delete local server cache file”.

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 1:
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.
Method 2:
First of all, make sure the ‘Browser Cache TTL’ in the ‘Caching’ section is set to ‘Respect Existing Headers’.
Then install WP Cloudflare Cache plugin. This plugin allows you to use cloudflare full page cache without affect logged in users and comment visitors. WP Cloudflare Cache plugin will also automatically purge the cache after publish post or update post.


WP Cloudflare Cache Plugin Settings:
1. Enter your E-mail Address and Cloudflare Global API Key
2. Add Expires Header Value

Note: After setup this plugin, you will need to create “Cache everything” page rule on Cloudflare.

My Cloudflare page rule settings
https://blogwp.ovh/*
Browser Cache TTL: an hour, Cache Level: Cache Everything, Edge Cache TTL: 2 hours

When you correctly set up WP Cloudflare 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

I use KeyCDN’s performance tool to measure the TTFB

The TTFB before settings

The TTFB after settings

Speed Tests Results

GTmetrix:

So far I’ve only installed 2 plugins

The speed optimization method can be summarized as: Nginx FastCGI Cache + Nginx Helper + WP Cloudflare Super Page Cache + Cloudflare CDN

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

Copied title and URL