How to Setup a CDN for Your WordPress Site
The loading speed of your website plays a crucial role for several reasons. First of all, it is one of the major ranking factors for most search engines. A slow loading speed will have negative impacts on your overall ranking, while a faster speed will complement your SEO efforts.
An excellent loading speed is also critical to delivering a good user experience. Visitors love a fast-loading site and are more likely to come back to a site that loads within seconds.
For all these reasons, you need to take special care of the loading speed of your WordPress site. While there are several techniques to do that, using a CDN service is a very popular choice.
In today’s post, I am going to show you how to integrate Cloudflare CDN with your website. Let’s get started with a quick introduction to the service.
What is Cloudflare?
Cloudflare is a professional solution to speed up and protect your website. It is a combination of different services like a Content Delivery Network (CDN), a web application firewall, and a distributed proxy server.
Unlike the traditional CDN services, Cloudflare works at the DNS level. It works as a proxy between your website and the visitors to protect your site against DDoS attacks. The service will analyze each incoming request, serve the assets it has stored in from your site, and pass the other requests for dynamic contents like posts and pages.
Why Use Cloudflare?
You might be wondering why you should use Cloudflare while there are several other CDN service providers. There are several reasons why we prefer Cloudflare for the beginners.
First of all, it is a lot easier to get started with the service. You just need to add your site to Cloudflare, get the nameservers, update the DNS records for your domain, and that’s it. Your site will be integrated with Cloudflare within an hour or so.
The simple integration process also means you can quickly reverse the process. You can get back to the previous condition just by reverting to the original nameservers for your website.
When using Cloudflare, your site will enjoy an additional layer of security. Since the service will process each request for the site, suspicious IP addresses will get blocked automatically, reducing the chances of DDoS attacks or other security threats.
Cloudflare offers a free plan that suits the requirement of most beginners, which is another reason why we recommend their service. You can get started with the free plan and upgrade to one of the premium plans later on.
How to Get Started with Cloudflare?
You need to create a Cloudflare account to use their CDN service. To do that, visit their website, and click the “Sign Up” button located on the top-right corner. This will take you to the registration page.
Provide your email address, password, and click “Create Account.”
In the next step, you will have to add your website. Provide your website URL in the Site field, and click “Add Site.”
This will take you to the next step, where Cloudflare will detect the DNS records of your website. Click “Next” to start the process.
At this point, you have to select a plan for your Cloudflare account. To keep things simple, I will choose the free plan. If necessary, you can select any of the premium plans to enjoy additional features.
Choose your desired plan, and click “Confirm Plan.”
The next page will provide you with a list of the DNS records for your website. Among these, the records marked with the orange cloud will be served by Cloudflare, while the others will load as usual. Make sure that your main URL (yoursite.com) and the www sub-domain URL (www.yoursite.com) are marked with the orange cloud.
Then, click “Continue” to move to the next step. In this step, Cloudflare will show your current DNS settings along with the new DNS settings. You need to replace the old DNS with the new ones provided by Cloudflare.
To change the DNS settings for your website, log in to the domain registrar from where you have purchased the domain. Find the DNS section, delete the old records, apply the new Cloudflare DNS records, and update the DNS settings.
Depending on your domain registrar, it can take up to 24 hours to integrate the new DNS settings with your website. In the meantime, your website will get served from the previous DNS options.
Exploring the Cloudflare Dashboard
Log in to your Cloudflare account to check out the dashboard. The dashboard offers a complete overview of your website that looks like the following –
First of all, you will notice the current status of your website. While the default status will be set as active, you can change that by using the “Quick Actions” button located on the right side. Clicking that button enables you to use two more modes –
- Under Attack Mode: This is useful if you think your website is under attack right now.
- Development Mode: This mode will disable caching on your website for the next three hours.
You will also find some advanced options to manage your website on Cloudflare. For instance, you can pause the CDN services for troubleshooting or remove the site from Cloudflare altogether.
While you can get started with a free account, Cloudflare also has some premium plans. Let’s take a look at the available plans.
Priced at $20 per month, the Pro plan offers web application firewall, built-in mage optimization, professional mobile optimization, 20 page rules, all browser support, simulation mode, I’m Under Attack mode, up to 24-hours historical data, and so on.
For $200 per month, the Business plan includes web application firewall with 25 custom rules, SSL support, cache bypass, 50 page rules, advanced DDoS support, custom nameservers, up to 7-day historical data access, priority email support, etc.
There is also an enterprise plan with lots of advanced features. You need to get in touch with Cloudflare to set up this plan according to your requirements.
Now that you know how to integrate Cloudflare with your WordPress site, you can use this free CDN service to get a better performance from your website. Let me know if you need any other help in completing the process. I will be glad to help you out.