Posted on Leave a comment

How to use Cloudflare on Child Sites

How to use Cloudflare on your Child Sites

Cloudflare is among the most solid CDNs out there and has a considerable amount of data centers.

To utilize Cloudflare for your child site, you first need to change the domain’s DNS name servers to use the Cloudflare name servers.

Now that your child site is using the Cloudflare name servers (which you can check from DNS Checker), the next step is to set DNS and enter the site domain. Cloudflare will show orange arrows for the domain in DNS, which means Cloudflare will be used. Cloudflare also has an option to check that the name servers are being used.

Cloudflare has a number of sections which will be covered. The first is Crypto, which is recommended to be set to full SSL mode. Other recommended crypto settings can be found in this post. The disable universal SSL step will depend on what is being used for the SSL cert on the child site. Cloudflare does provide a universal SSL cert for each domain setup.

Make sure that the MainWP Dashboard server IP is not being blocked in the firewall. This is a key point, as you will need to make sure that the IP is allowed.

Firewall > Tools > IP Access Rules

Find the MainWP Dashboard IP address, and then set the address to be allowed. You can find the server IP either from the hosting managing provider you are using, or from the domain DNS manager. Another way is to use a DNS checking such as DNSChecker or whatsmydns. Enter the domain of the MainWP Dashboard site, then select ‘A,’ and you will find the server IP address.

Speed, caching, and page rules are covered below with the recommended settings. Cloudflare will cache site assets like CSS and image files, which means those will be served from the nearest edge server to the site users request, and not from the site server. Cloudflare is powerful in offering page rules. Page rules ensure that a static HTML version will be cached and served from Cloudflare for all posts and pages on a site.

Speed
Brotli > On

Caching
caching Level > Standard
Browser Cache Expiration > 1 day
Always Online > On

Page Rules
sitedomain.com/*
Browser Cache TTL > a day
Always Online > On
Cache Level > Cache Everything
Edge Cache TTL > 2 days

siteomdain.com/wp-login.php*
Disable Security
Browser Integrity Check > Off
Cache Level > Bypass
Disable Apps
Disable Performance

sitedomain.com/wp-admin/*
Disable Security
Browser Integrity Check > Off
Cache Level > Bypass
Disable Apps
Disable Performance

You can integrate Cloudflare with your child site if you needed to purge the Cloudflare cache from site using a plugin. Next, you will be asked in the plugin settings for the Cloudflare account email which was used as well as the API key. The global API key can be found in Cloudflare from:

My Profile > API Keys > Global API Key

From there, you can purge the cache as well as change any of the main settings in Cloudflare from the plugin settings on the child site.

Cloudflare also protects your child side, if needed, from brute force attacks. If the child site comes under a DDoS attack, you can select I am Under Attack Mode.

Cloudflare has many other options if you use any of the higher plans, including image optimization using mirage, as well as something very powerful called workers. There is already a plugin for Cloudlfare page cache. You can read more about it in this article on Cloudflare.

Cloudflare is an easy way to be able to improve your child sites performance and will help improve site load times.

Get MainWP News and Notifications

Sebastian Moran on Github
Sebastian Moran
Sebastian Moran is a WordPress performance expert and technical liaison for MainWP.
Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.