Cloudflare Workers Wordpress

How to improve Wordpress speed with Cloudflare Workers

By Tech Start XYZ | techstartxyz | 23 Jan 2020


What is the Cloudflare Workers feature?


The Cloudflare Workers tool allows the execution of JavaScript code directly at the edge of Cloudflare.

This means that when using this feature you can execute JavaScript code using the Cloudflare infrastructure.

This feature opens up a range of possibilities and can provide the user with a more fluid and safe browsing experience.

Therefore, we can configure this feature to achieve a better performance when loading pages.

If you are trying to optimize your site and are having trouble reducing TTFB this tip is for you!

How to Increase WordPress Speed Using Cloudflare's Workers Feature

First of all, we must access the Cloudflare account and navigate on the Panel to the Workers option.

Cloudflare Workers

As we can see Cloudflare offers 100,000 requests per day for free, this should be sufficient for small sites and blogs.

After that, we must click on the Launch Editor option so that we can start configuring the script responsible for the optimization.

Then click on Add Script, define a name for your script, it can be any name.

Cloudflare HTML cache

After configuring a name for your script, click on the Edit option so that we can change the script.

On the editing screen, delete any script that was created automatically.

Cloudflare optimize Wordpress

Once this is done, you must insert the script found in the link below, copy and paste the script into Cloudflare Workers.

Download link on Github:

https://raw.githubusercontent.com/cloudflare/worker-examples/master/examples/edge-cache-html/edge-cache-html.js 

The script should look like the image shown below, now we just have to add some information to it.

Setup Cloudflare Workers

Now you must fill in the data requested on lines 8, 9 and 10, just search for the information on the links below:

email: “”, // You can find this in  Account Setup 
key: “”, // Global API also in Account Setup
zone: “”, // And Zone ID here Account Setup

After setting up the data above, you need to add the Route, click on Routes and go to the Add Route option.

Cloudflare Workers script

In the first field you must enter the URL of your website, in the second option select the script you have configured.

Once this is done, click Save, then click on the Script option and press the Deploy button.

All set, now your script is already configured and you can already see the difference in the performance of your WordPress site.

How do you rate this article?

0


Tech Start XYZ
Tech Start XYZ

Um blog sobre Tecnologia, Hackers, Linux, Windows, Privacidade, Internet e outros assuntos! Acesse: www.techstart.xyz


techstartxyz
techstartxyz

Just a blog to talk about hacking, malware, cyber war, privacy, cripto and tech stuff.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.