What is Cloudflare?
August 01, 2021
Cloudflare is a service which, among other things, provides a CDN (Content Delivery Network), firewall, and performance layer for your website. It has plenty of paid upgrades and features and is a developer’s dream, but what advantage does it have for you to put your website “behind” Cloudflare and how does it work?
Asset caching
Cloudflare has some mega servers which cache your static assets for you, once they have been requested once. This has a huge benefit of saving your server load and bandwidth. With a non-cloudflare’d server, if a user requests a web page which features 10 images, the browser has to make 10 additional requests to your server. If each image is 1MB, that would be an extra 10MB your server would have to find, process and serve. This, multiplied by each user on your website, is more load and takes up valuable resources which could impact performance for other users.
With Cloudflare, they do Asset Caching. Once each image has been served once, they store a copy on their servers. When the second user requests the same image, Cloudflare serves it up from their servers, meaning your server has more time to do the important things - like processing that transaction or sending that email. It also helps your website performance, as many hands make light work.
Some users receive up to a 90% caching rate!
If you want to take it one step further, you can cache static pages as well. Pages without contact forms or dynamic content are ideal candidates for this.
Worldwide CDN
Along with the asset caching, Cloudflare has a worldwide Content Delivery Network. With this, your cached asset gets replicated across servers in over 200 cities worldwide. When your user requests an asset, rather than serve it from your server which is in one location, Cloudflare will serve up the asset from the nearest server, meaning your website loads fast all over the world, not just near the country your server is in.
With a combination of the CDN and caching, sites that take about 1.3 seconds can shave off an entire second!
Firewall & DDOS Protection
Along with the caching and CDN, Cloudflare helps protect your site against brute-force attacks and threats against your website. Cloudflare has the advantage of serving over 12 million websites and so can identify malicious bots and users more easily than any operating system firewall. If Cloudflare thinks you are suspicious, it can show a challenge which allows “normal” users to still access your site. These firewall and security measures are ever evolving and being developed, meaning every day your website is becoming more secure and protected.
Security - no direct logins needed to your Cloudflare
On the topic of security, you have the ability to allow control with others without sharing your login details. More and more companies are heading in this direction recently and Cloudflare is no exception. You set up the account in your name with your email address and delegate. This means you don’t have to share your password and can revoke access at any time.
Nice DNS management
This is a slightly nerdy one, but the DNS management within Cloudflare is excellent, and can be controlled via an API. DNS records are like driving directions for your browser. When you enter your domain name, the DNS records tell your browser where to go to get to their destination. This doesn’t normally affect day-to-day operation, but being able to update your records easily saves a lot of time should you need to change your server or add a verification record (usually Google Search Console requires this).
What's even better is that you can get a lot of the nice to haves on the free tier! So even if you aren't using it in a corporate setting, it's mighty useful for personal use too.
