An incredibly popular and easy to set up a content delivery network is Cloudflare. I'm here on cloudfare.com, and I've selected Pricing to show you the options that are available.
And you'll see that they have a free version which means there's no excuse to not set this up. What I'll like to do is show you how to set up Cloudflare with WordPress, because this is a very common scenario, and it's also one of the easiest to get configured.
I'll start by going into our WordPress Dashboard. So by far, the easiest way to set up Cloudflare is with a Plugin, so we'll start by going to Plugins in the bottom left-hand corner, and then choosing Add New.
In the upper right-hand corner, I'll search for Cloudflare.
And here on the right-hand side, I'll choose Install Now, and then Activate.
Next, we'll need to configure the settings for Cloudflare, so I'll select Settings from the Plugin menu.
To start we need to create a free account. I'll go ahead and set one up. Once we've created our account, we'll add in our Domaine Name.
For us, it would just be saltandsimple.com, and then I'll choose Add Site.
I'll choose the Free plan, and choose to Confirm plan.
So the first screen that we encounter is asking us to review our DNS records.
Now if you're unfamiliar, DNS is essentially the phone book of the Internet. It allows you to translate Domaine names to IP addresses, and it's essentially how a user can find your website.
One thing that's important to know within a Content Delivery Network is that the Content Delivery Network is going to essentially bypass your server to send traffic to the various cash servers. This means the Content Delivery Network, needs control of your DNS. So if you're currently managing your DNS records at your web host, or where you registered your Domaine Name, that's going to have to change. You're now going to have to manage those DNS records with Cloudflare.
So, you want to confirm that Cloudflare has captured all of the correct DNS records. In this case, you'll see that we have some text records, which were used for google site verification, as well as my ?? salt site verification. Now if these are no longer relevant I can choose the x icon to remove them, however, there's no harm in leaving it as is. It is, however, important that you verify that all of this is set up correctly. You may also see MX records which control your email. You want to review what Cloudflare has in it settings versus what you have in your current settings, to make sure everything maps over. If anything is missing, you can add the record using the bar at the top. And from here you're going to configure your name servers to point them to Cloudflare.
And this is going to take the DNS control away from wherever it is now. In this case, my DNS is managed by Lightsail. And Cloudflare is going to ask me to have the DNS managed by them. Now if you don't want to change your name servers, for example, if you're on Amazon Lightsail, you can use Cloudfront which is their CDN network, and maintain control all within Amazon still. However, if you want to use Cloudflare, you're going to configure the name servers as such. They will provide you with helpful articles, in this case, Namecheap is where I registered this Domaine name. So, I can click here to read how to set these name servers. Once you've changed your name servers, it's as simple as choosing done, check name servers, and following the remaining prompts. Now I will point out anytime you make a change to your DNS, and your name servers, there is likely the possibility that your site is going to have some interruptions. So, it's important to consider the timing on when you do this.
Once everything has been configured within your Cloudflare account, you'll be able to go back into the Plugin and sign in.
You'll need to enter the email that you used when you signed up, and the API Key from within your Cloudflare account.
You'll find that from cloudflare.com, by logging in, and from your account, you'll select My Profile in the upper right-hand corner from the drop-down.
Next, you'll select API Tokens at the top of the screen, and then choose to create a token towards the right-hand side.
Below Token name, I'll choose to start with a template, and then I'll choose Use template next to WordPress.
And then I'll choose to Continue to Summary,
and then I'll select Create Token.
Now I can copy the token,
return to WordPress, and paste in that API Key and I'll choose Save API Credentials.
And now we have Cloudflare configured of WordPress!
And the first thing you'll want to do is chosen to Apply Cloudflare recommended settings to ensure your optimal site performance.
And there you have it. Now, Cloudflare is configured, and you're operating with a CDN. Now there are a number of nuances with using a CDN. For example, if you change file images, you're not going to see them reflected on the Web. Which means you'll have to Purge the cache, which tells the CDN to fetch a fresh version from your server. This can cause some nuances, however, the pros greatly outweigh the cons, and I encourage you to get familiar with CDN's.