Cloudflare is a Content Delivery Network (CDN), but it’s also a firewall and a performance layer for websites. It offers a multitude of features and enhancements (available at extra cost) and developers think it’s great, so let’s explore what they like so much about this service.
Caching your non-dynamic assets after they’ve first been requested will reduce the load on your server, one of the benefits that Cloudflare brings. It will also help to cut the amount of bandwidth being eaten up. This is a big deal because without Cloudflare, for every image on a page that’s requested by a user their browser needs to make an extra request, so if there are lots of assets on the page, that will soon add up, and add strain to the server. At one MB per image, a page with a dozen photos will be burdening it with an additional 12 megabytes of finding, processing, and serving, and, if you multiply that by everyone else who is accessing the site it’s easy to see how your resources can become tied up, which slows the experience down for everyone.
Cloudflare’s Asset Caching is a neat way of getting around this problem. When an image has been served for the first time, a copy is placed on its servers (meaning the asset is cached). The idea is that all subsequent requests will then be met by Cloudflare servers rather than your local server. This eases the burden tremendously, so your machine is free to get on with keeping your website running at optimum speed.
Here is a screen capture from the Cloudflare account of a client of ours, showing some stats from this week just gone – that’s a 90% caching rate.
To ease the burden on your server even more you can also apply this process to static pages. It’s particularly well suited to pages with dynamic content or contact forms.
In addition to asset caching, Cloudflare’s global Content Delivery Network replicates the process in excess of 200 world cities. This makes for much faster page loading times no matter where the person requesting the pages in the world because the network will always choose the server that’s closest to them. A typical user has reported a Worldwide average loading time for their home page that dropped from just over one second to just over one-third of a second.
DDOS and Firewall Protection
Cloudflare also offers protection from cybercrime activity such as brute-force attacks. As it covers more than 12 million sites it’s ideally placed to identify users and bots with malicious intentions. This experience gives it a distinct dynamic advantage over your local security.
In the event of suspicious activity, it can generate a verification challenge to make sure that the user is genuine. The protection available is constantly evolving to match the tide of constantly evolving threats, Which means that your security is always up to date.
Your Cloudflare and Domain logins Stay With You
When you use Cloudflare you can share your account with us without letting us know your login information. This is an approach that a lot of companies are taking now. Create the account in your own name using your e-mail address and we will be able to access it. You won’t need to share a password and you can remove our access privileges at any time.
Great DNS management
Nerds will be pleased to know that Cloudflare offers great DNS management using an API. DNS records are a bit like the post office. They can tell your browser where to find a website. You type in the name, and the DNS records turn it into the exact location. This isn’t something that typically affects your normal operations, but the ability to update your records easily can be a real time-saver if you ever need to switch servers or include verification records (as Google Search Console insists upon).
Everything we’ve described so far is included with a free Cloudflare account. Upgrading to pro or business accounts gives you access to even more useful tools and features. These include:
- Image optimization – if the user’s browser supports a particular modern format, this feature uses it to serve them, because smaller images load much more quickly.
- Better delivery – enabling HTTP/2 makes web pages load more quickly and serves them in the most efficient order
- Additional page rules – these let you do caching, redirecting, or any one of a number of other things to pages and URLs before the user gets anywhere near your server. The free account gives you three, and with upgrading the number increases.
- improved security – the Pro offering and above gives you better firewall protection.
If you have mission-critical projects then you probably want to take a look at the pricing page, which recommends using the Pro version as a minimum, to be on the safe side.
You don’t get Cloudflare workers with the regular service, but you do if you use it for your DNS. They let you run your own applications on Cloudflare’s servers or alter intercept requests for an image or page to make it do more.
We used Cloudflare workers to shut the door on an extra request to one of our client’s servers. As of this writing, our Cloudflare usage has reduced the load on their server considerably, by an amazing three and a half million requests, just in the last seven days.
How to Set Up for Your Domain in Cloudflare Account
How can you activate Cloudflare for your domain name? You have two options to choose from:
Using a CNAME record for www.mydomain.com — you can access CNAME setup for both the Enterprise and Business Cloudflare packages.
Directing a domain name to Cloudflare nameservers after you create a Cloudflare account, though you’ll need to take extra steps to ensure your domain functions properly. We’ll cover those steps below.
After you sign up for your Cloudflare account, the software will redirect you to set up your initial domain name. Enter the domain name you want to enable Cloudflare for, then tap the ‘Add Site’ button.
Pick a Plan
Then, you will move to the next page in the process, on which you will pick your preferred plan. The Free package is available as default — if you want to start with this, click on it then press the ‘confirm plan’ button.
You might choose to sign up for a paid Cloudflare plan at a later date if you’re impressed and want to take advantage of additional features. Check out https://www.cloudflare.com/plans/ if you would like to compare and contrast the different plans.
Check Your DNS Records
The next stage includes a list of your current host records. Make sure you check that the DNS records specified align with those in your Plesk or domain registrar dashboard before you proceed. However, we recommend that you DO NOT modify your DNS records at this point in the process — you will be able to do this later once you finish the setup. Scroll down then tap ‘continue’ if all records listed are right.
During the next step you need to change your existing nameservers to your Cloudflare ones instead. For this purpose you should modify the nameservers of the domain on the level of your domain registrar.
When you have finished configuring your nameservers, you may need to wait one or two days for local ISPs to adjust their DNS caches and allow users to view your site. As caching time differs from one ISP to another, you will need to allow time for the entire DNS change to be completed.
After you set up your nameservers, go back to the Cloudflare tab then press the ‘check nameservers’ button. If you’re satisfied that the nameservers have been updated correctly, the ‘active’ status will be displayed.
Configure DNS Records
Next, you can go to the DNS menu to set up DNS records and conduct any DNS change you need to. You can add or remove your domain’s DNS records on the DNS Records page. Click on the ‘add record’ button if you want to add a record, then pick the relevant record type, the hostname (for the domain itself or the subdomains), and the value of the record. However, the TTL will be automatically set up. Press the ‘save’ button when you’re sure the record is ready.
You can activate or deactivate the Cloudflare service for every record easily. Just press the gray/orange cloud icon below the ‘proxy status’ column.
Please be aware: All of your domain’s DNS records in Plesk will become inactive once the nameservers change. That’s why you need to ensure that they have been properly configured in your Cloudflare account, and the new DNS records should be made in the Cloudflare account too. For example, if you want to update your domain’s IP address or change to a different mail service, update the MX and A records appropriately.
Thanks for the detailed article. I was considering to go for CDN, but was apprehensive to change the DNS settings. Now I will opt for Cloudflare CDN !
Can you still use a free Let’s Encrypt Certificate for the domain and have it auto-renew if you are using Cloudflare DNS?
It will depend on the SSL/TLS encryption method being used on the Cloudflare side and whether the IP of the domain is being proxied. The certificate can be issued as expected if the IP in question isn’t proxied. Here’s a link to read more. I hope this helps.
Thank you for the reply.
The “read more” link you provided does not work.
Hi Michael, perhaps this one works better. 🙂
I’ve done this but I still see actual client IP addresses in our Apache HTTP logs. Is that normal?
Hi Jason, we suggest you open a ticket with our dedicated support, as they can look at your specific settings to see what’s up. I hope this helps you further.