Improve WordPress with Cloudflare

Improve WordPress site Speed with Cloudflare

Last update:

Yes, WordPress with Cloudflare is a great combination. It help you improve your WordPress site speed and security!

Over the last few years, Cloudflare’s popularity as a DNS (Domain Name System) company has grown. In addition to their DNS services, they provide DDoS attack protection, CDN (Content Delivery Network), firewalls, WordPress optimization, domain registration, and many other service add-ons. All of these services are related to being the first chain-link in charge of serving a web page.

Table of Contents

How does Cloudflare work?

The first step in the sequence of tasks involved in serving a web page is name resolution.

When you type an address into your browser, for instance, https://wetopi.com, the first thing the browser does is ask a Name Server where the wetopi.com page is served.

This is where Cloudflare comes in.

When Cloudflare acts as the DNS, it answers with the web server address. So far, this is no different from other DNS services provided by domain registrars or hosting companies. However, what changes is how Cloudflare responds.

Cloudflare can respond with a DNS from more than 250 geographical points. Thanks to this, visitors receive the answer from a DNS close to their location. And closer means less latency, thus more speed.

What does Cloudflare Proxy Mode mean?

Here comes the big difference with other DNS. Cloudflare takes advantage and acts as a proxy, that is, it gets ahead of your server. But there is more, Cloudflare takes advantage of its entire distributed network of servers, so it can also act as a CDN.

Cloudflare is something more than a CDN

When you enable Cloudflare’s proxy mode, your website’s content requests go through Cloudflare’s servers first. This allows Cloudflare to provide additional features and services.

Improving the speed and security of WordPress with Cloudflare

Cloudflare’s DNS service is free in their “Basic” plan. The best part is that you also get access to almost all their services in their “simple” or “low-advanced” mode.

Here you have a shortlist of services that will help you improve WordPress speed and also increase security:

SSL security

You can add HTTPS to your site, even without having certificates on your own server.

You can add HTTPS security to your site, even without having certificates on your own server. The good thing is that Cloudflare offers you SSL service with the last protocol version, the HTTP/3.

Firewall

A Firewall with filters and rules, detection of Bots, blocking of DDoS attacks.

Of course, if you want to have fine-grained control, you have to upgrade to a payment plan.

Protect content on your site

In the “Scrape Shield” section we can activate protections such as e-mail address obfuscation, protect against hotlinking, for example, to protect images against links outside our website.

Speed ​​optimization

By default, it reduces the size of your content with the help of compression techniques. It even adds modern protocols like Brotli (with wetopi, you already get Brotli by default).

To improve WordPress speed, one of the paid features you can add to your Free plan is APO: Automatic Optimization for WordPress

Roughly,  APO generates static versions of your webpages and uses the Cloudflare Workers to serve them from its distributed nodes around the globe. It is as if it were an “extended” CDN capable of serving not only images and javascript but even your optimized html.

APO uses a WordPress plugin that transparently manages tasks such as clearing the cache every time you update the content of a page.

Consider using APO for WordPress if any of the following scenarios resonate with you:

  • You have a poorly optimized WordPress site, and you cannot afford an optimization.
  • Your site serves an international audience.
  • Your website has an important base of pages that can be static.
  • You have high TTFB (Time to First Byte) (Let say a TTFB greater than 1 second).

There is a good APO study.

Cache / CDN

Cloudflare operates as a CDN pull service. This means that when a user accesses your website, the initial request goes to your server. Cloudflare then caches the images, JavaScript, CSS, and even the initial HTML request (the first byte, which serves the so-called Time to First Byte, or TTFB) at the node closest to the region where your visitor is located.

Map showing how a site with Cloudflare reacts when using the CDN Anycast Network

The Cloudflare Free cache already provides a substantial improvement in response time. Things are not so good when we talk about permanence and content spread on remote nodes. 

Here comes an interesting option:  Argo. Another Pay-Per-Use option that you will find in the “Traffic” section:

Section for Argo Smart Routing. A good option to improve the speed of your WordPress

Argo is an advanced CDN option that Cloudflare calls “Tiered Cache.” Essentially, it intelligently brings the contents of your website to the final consumption nodes.

In the past, this option was only accessible in paid plans, but now you can activate it in your free account.

You can see the pricing details.

At wetopi, we have been using Argo for a long time and the result is very good:

Table showing how WordPress with Cloudflare Argo give us impressive Loading times around the globe

How to use Cloudflare with WordPress?

Step 1:

If you don’t have a Cloudflare account yet, visit the Cloudflare website and sign up for a free account.

Step 2:

Now you need to tell Cloudflare that you want to manage your website.

Click on the “Add site” option that you will find in the top menu bar of Cloudflare.

First step, adding our sitamet.com WordPress site with Cloudflare

In this step what you are doing is preparing Cloudflare to start managing your domain’s DNS.

Cloudflare will then ask you to select a plan. We recommend starting with a free plan that works well for most users. Choose the “Free” option and click “Continue”.

Cloudflare will immediately scan all possible zone configurations that the domain may have defined. If you already had the domain name up and running, go carefully and compare one by one the zone definitions that you have in your current DNS manager. Cloudflare is not always able to find out all defined zones.

Screen of DNS zones located by Cloudflare
The DNS zones marked as Proxied, are those that Cloudflare manages in its CDN network.

When you click Continue, Cloudflare will indicate the two NS (Name Servers) that will manage the DNS of your domain.

Step 3:

This step is important.

To change the NS, you have to go to your current DNS manager, usually, your domain registrar.

Screen where it indicates the change of NS to be able to improve the speed of WordPress with Cloudflare and its DNS network

Attention do not confuse the DNS or NS (Name Servers) with the “DNS Zones” or “DNS Record”.

In our case the registrar is Mrdomain (Dondominio) and the NS change section is designated as DNS:

Screen with the old NS where you have to put the new ones provided by Cloudflare
Section in our registrar with the option to Modify the DNS

After saving the changes we will have to wait. Name server updates can take 24 hours to process. You will receive an email when your site is live using Cloudflare Name Servrs.

You don’t have to worry about waiting. When you change nameservers there is no downtime

Tips when using Cloudflare with WordPress

1 If you are making changes to your WordPress, activate development mode

This disables Cloudflare’s cache and allows you to instantly see the changes.

 Cloudflare Dashboard Quick Access Menu

2 In case of any errors or strange behavior, clear cache

First of all, clear your WordPress cache (if that’s the case) and then Cloudflare’s. You have a quick link: Purge cache.

3 Prepare for DDoS attacks

At Wetopi, we are prepared for massive DDoS attacks. However, WordPress has a well-known weak point: “heavy uncacheable pages.” Attackers can sneakily bypass WordPress caches and target these heavy pages, depleting your server’s resources without you or our DDoS firewalls being fully aware.

In this situation, Cloudflare is of great help when working in proxy mode.

Always have the credentials to the Cloudflare panel at hand . You’ll find the “Under Attack Mode” switch on the quick access menu.

Cloudflare plugins for your WordPress

If you want to “automate” the previous cache management, you can combine a few WordPress plugins with Cloudflare to facilitate management operations from your admin dashboard.

From wetopi we do not consider it strictly necessary. We prefer that you be clear about the precautions and always have the Cloudflare panel at hand.

If you are looking to improve the speed of WordPress, always try to use the minimum essential plugins.

Cloudflare has afresh new management panel and very good online help.

Attention, there is a free plugin that deserves our attention “WP Cloudflare Super Page Cache“. This WordPress extension imitates the previously described paid APO functionality and can be a good alternative and free option

Conclusion

From wetopi, we strongly recommend the adoption of Cloudflare with your WordPress site. The specialization of DNS services is an important step towards the professionalization of a website.

DNS management is one of those “size matters” services. Moving to Cloudflare can be a bit overwhelming, especially given the number of options available. However, transitioning to an Anycast DNS network with more than 250 nodes is worthwhile in itself. Additionally, with performance and security improvements against DDoS attacks, you couldn’t ask for more.

We are techies passionate about WordPress. With wetopi, a Managed WordPress Hosting, we want to minimize the friction that every professional faces when working and hosting WordPress projects.

Not a wetopi user?

Free full performance servers for your development and test.
No credit card required.

See how Wetopi stacks up against your current hosting

Try before you buy.

With no obligation on your part, we’ll migrate a copy of your website:

No hidden small text.
No commitments.
No credit card.