Security Tutorials

How to speed up your website with Cloudflare ®

I hope you have heard the hype behind Cloudflare, if you have not, this article is probably going to get you excited. Cloudflare is an amazing value that provides the benefits previously only reserved for those who could afford hundreds a month in hosting services. The best part is, Cloudflare is free for a majority of the benefits provided.

What is Cloudflare?

“Cloudflare is on a mission to help build a better Internet.”
Cloudflare is one the largest networks in the world, providing its services on both small websites and the largest organizations like Reddit. They boast over 25 million websites to which it provides security, content delivery, and performance. The service is best described as a Content Delivery Network (CDN) and reverse proxy. That may sound scary to those of you who are not technically proficient, but don’t worry, the beauty of Cloudflare is how easy it is to deploy on your blog or website.

How does a website work?

With a typical website setup, a visitor would enter your domain into their browser. Next, the browser looks up the connection information of your web server through a process called DNS. Finally, the browser directly connects to your web server and retrieves the webpage to show to the visitor. The browser is responsible for downloading everything needed to properly make your website display and be functional, including images, JavaScript, and various other resources. Many smaller websites only have a single or few web servers in a single location, which increases the load time of a user the farther they are from the webserver.

How does Cloudflare help?

Cloudflare sits between a visitor and your webserver. When a visitor tries to access your website by typing in your domain to their browser, they receive the connection information of Cloudflare instead of your web server. The visitor then connects to Cloudflare and its network connects to your webserver, allowing for their network to monitor and protect your website. This provides the following benefits:

  • Offloading work and lowered bandwidth consumption
    By caching a majority of static content (like pictures, JavaScript, and other website components that don’t often change) fewer requests are made to your web server, increasing the capacity it can serve.
  • Increase the loading speed of your website
    When Cloudflare caches static content, it distributes it across their network, allowing a user on the other side of the world from your webserver to receive the file as if the webserver was next door. In addition to caching, the network can optimize the path across the internet it uses to contact your web server, increasing the speed further than your website can do on its own.
  • Improve website security
    Cloudflare has a suite of security features that are easy to one-click deploy on your website. Their advanced network has learned a lot about what genuine traffic looks like, and what traffic from an attacker looks like. Cloudflare also has free protection against level 3 and level 7 DDoS attacks. Learn more about how to protect your WordPress blog here.

How to setup Cloudflare

This is the hardest part of deploying Cloudflare on your website, which is a good thing because it’s rather easy. You can follow this guide here for some more details.

  1. Create a Cloudflare account
  2. Add your domain
    1. On your dashboard, select “Add a Site”
    2. Enter your domain
    3. Cloudflare will try to discover your DNS records already setup, it can take a few moments for this process to complete
    4. Choose a plan level, the free plan has a great number of benefits, but you may want to consider a higher plan for increased flexibility and access to their custom Web Application Firewall.
    5. Cloudflare will display DNS records it believes your website utilizes, here you will want to ensure your A (and AAAA) records are pointing at the IP of your web server.
    6. Press continue
  3. Change your name servers. Login to the account of who you purchased your domain through. If you have difficulty finding the setting, your domain provider should be able to assist you. Change the name servers to the ones provided by Cloudflare.
  4. Sit back and wait! The domain propagation process takes a while to complete.
  5. You’re now on Cloudflare! You should receive an email containing the confirmation that your website is set up and ready to receive the benefits available.

Configure for speed

You should notice an immediate change in the speed of your website. It can take a short time for the system to begin caching your website. You may want to poke around a bit in the settings and enable things like brotli compression and auto-minify. Thank fully the dashboard is super organized, so you can find all settings related to speed under the speed tab.

If you are interested in furthering the security benefits attainable from Cloudflare, follow our security guide here.

*Cloudflare is a registered trademark of Cloudflare, Inc.* This website, and article, are not in affiliation with or endorsement, sponsorship, or support of Cloudflare.
-Images and trademark are utilized within the Cloudflare Trademark guidelines.