Cloudflare: speed up WordPress with Automatic Platform Optimization plugin
Tags: performance, tutorial
Published: 2022-04-01 14:49:17

---
title: Cloudflare: speed up WordPress with Automatic Platform Optimization plugin
published: true
date: 2022-03-30 08:05:01 UTC
tags: performance,tutorial
canonical_url: https://rtfm.co.ua/en/cloudflare-speed-up-wordpress-with-automatic-platform-optimization-plugin/
---

![](https://cdn-images-1.medium.com/max/393/1*8nYC3Cqib-3Ets67ERqUqA.png)

The [rtfm.co.ua](https://rtfm.co.ua/) blog is quite slow for users.

For example, you can test your website using the [https://gtmetrix.com](https://gtmetrix.com/):

![](https://cdn-images-1.medium.com/max/1024/0*FNA_QPkehpf7jyqf.png)

4.3 seconds till full load! That’s awful.

At the bottom of the results, you can check the top of issues on a site:

![](https://cdn-images-1.medium.com/max/882/0*fonJtHXIfPGUzuuc.png)

At first, the page size is 1.16 MB, which is big enough.

The second thing is to check what’s exactly is loaded too slowly — JS, CSS.

Here can be various solutions, such as caching pages on the website’s side, adding a CDN, etc.

As a local solution, you can use plugins like [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/).

Another way could be to use Cloudflare, which will provide “all in one” — CDN, anti-DDoS, WAF, etc.

For WordPress, Cloudflare created a plugin [Automatic Platform Optimization (APO)](https://www.cloudflare.com/pg-lp/speed-up-wordpress-with-cloudflare-apo/), which will do all the necessary operations automatically, although that will cost you $5/month.

Its documentation — [Get started with APO](https://developers.cloudflare.com/automatic-platform-optimization/get-started/).

### Cloudflare

#### Registration

To start with the plugin, first, you need to register an account, for example, directly from the [plugin’s page](https://www.cloudflare.com/pg-lp/speed-up-wordpress-with-cloudflare-apo/):

![](https://cdn-images-1.medium.com/max/577/0*FIll3y_kRaTT4WdG.png)

Then, add your website:

![](https://cdn-images-1.medium.com/max/1024/0*DAZZ52RLVsWeEgOq.png)

Confirm your APO’s subscription:

![](https://cdn-images-1.medium.com/max/1024/0*djwaZdZHHaoG_Hes.png)

If you already have an account on Cloudflare, you can activate the plunging from the _Speed > Optimization_:

![](https://cdn-images-1.medium.com/max/1024/0*Mi0EQmNxCRHVdIKl.png)

#### DNS configuration

Cloudflare will check your domain’s current settings on the current name servers:

![](https://cdn-images-1.medium.com/max/887/0*UO5Z5jmr6ozc8BP_.png)

After that, it will configure its own name servers and will suggest you change NS at your registrar.

At this moment, my domain is served by AWS Route 53, so need to update Name Servers to the Cloudflare:

![](https://cdn-images-1.medium.com/max/887/0*xBoNc1oTpTiK2mTW.png)

Before doing that, check if Cloudflare is ready to return records about your domain:

```
$ dig +short @ethan.ns.cloudflare.com rtfm.co.ua
139.59.205.180
```

Once it will work, update NS at your registrar, wait a couple of minutes, click on the _Done_, and if you’d like, go through the _Quick Start_ steps:

![](https://cdn-images-1.medium.com/max/919/0*0H3kZT04prGIlH6X.png)

Anyway, you can configure these settings later. For now, let’s proceed with the Automatic Platform Optimization plugin.

### WordPress Cloudflare plugin

Go to your blog’s admin page, _Plugins > Add new_, find the Cloudflare:

![](https://cdn-images-1.medium.com/max/1024/0*AiU4zT_TtXRg7D7M.png)

To configure the plugin’s access, in your Cloudflare account go to _My Profile > API Tokens > Create Token_:

![](https://cdn-images-1.medium.com/max/1024/0*8SeTzmi1vMp4f_FW.png)

From the templates list, choose WordPress:

![](https://cdn-images-1.medium.com/max/728/0*poog7g5RCv2jG0zg.png)

![](https://cdn-images-1.medium.com/max/921/0*LcCNFKTmHMpjfAmX.png)

Go back to your blog.

From the _Settings > Cloudflare_, log in to your Cloudflare account using login (email), and the APT token, created above:

![](https://cdn-images-1.medium.com/max/1024/0*UFsKpHOQbcv5foD0.png)

Here, you can configure all necessary settings with just one click on the _Apply_, and Cloudflare will do all the rest for optimization, security, etc:

![](https://cdn-images-1.medium.com/max/1024/0*5Lt7MB1Y7koYxP3g.png)

A bit blow, enable the Automatic Platform Optimization:

![](https://cdn-images-1.medium.com/max/1024/0*y4Ai-SHf8F6sa69R.png)

Actually, that’s all.

Now, let’s check the test results again:

![](https://cdn-images-1.medium.com/max/1024/0*11CJ3x9nEE9yDdgP.png)

Comparing with the first results:

- time to load: was **4.3** seconds, now it’s  **2.6**
- page size: was **1.16** MB, now **716**  kb
- general rating: was **D** , **65%** , now **A** ,  **96%**

Done.

_Originally published at_ [_RTFM: Linux, DevOps, and system administration_](https://rtfm.co.ua/en/cloudflare-speed-up-wordpress-with-automatic-platform-optimization-plugin/)_._

* * *