A step-by-step guide to implementing Cloudflare to boost your website security & load time.
Your site load time & security are two essential elements for the online success business. Not necessary for E-Commerce but any type of business including your personal blog. The fast-loading web page gives a better user experience and boosts search engine ranking.
Nobody likes a slow loading website, do you?
There are multiple ways to add security & supercharge your site, but I found Cloudflare is probably the easiest one.
A little introduction about Cloudflare if you are not sure what I am talking about.
Cloudflare is a CDN & Security company powering millions of websites including Geekflare. Cloudflare has more than 75% of the market share in Alexa top 1 million sites.
That explains a lot and gives enough credibility to use it. Cloudflare got more than 200 network POP (point of presence) across the world which means the request is always served from the nearest location faster.
To show the difference in load time before and after, I’ve used my test URL with the following setup.
- I am using “techpostal.com” which is hosted on Site Ground under a $3.95 monthly plan.
- I’ve set up WordPress with the Maker Pro child theme of Genesis without any cache, security plugin.
- I’ve also disabled SG cache by Site Ground to avoid any caching for better consistency in the test.
Site load time before Cloudflare
Let’s see how much time it takes to load techpostal.com without Cloudflare. I used BlazeMeter to run a test for 5 minutes.
Let’s focus on these number (will compare the performance after Cloudflare)
- Average response time – 692.8ms
- 90% response time – 877ms
Onboarding your website to Cloudflare is quite easy, and you can get it started in just a few minutes.
The following, I’ve used their FREE plan and procedure will apply to any website including WordPress, Joomla, Magento, etc.
Let’s get it started…
- Create a Cloudflare account
- Enter your website and click “Scan DNS Records.”
- It will take a minute to scan existing DNS records, click continue
- You will see the existing DNS records for your website. If they look good then continue else you can modify it here.
- Select the plan and continue
- You will be asked to update the existing name server record with Cloudflare. This you got to do at Domain registrar. If you are not sure, you can refer to this guide.
- Until the name server is updated, you will see the status as pending on the Cloudflare dashboard.
Note: you may use the DNS record lookup tool to verify the NS record.
- Once updated, you will notice status is active.
This concludes your website is successfully routed through the Cloudflare network and ready to take performance & security advantages.
The default configuration is ok but if you want to take maximum benefits, then you may considering doing the following.
HTTPS Rewrites – if you intend to use SSL then you got to activate “HTTP Rewrites” to ensure all resources are loaded over HTTPS and avoid any mixed content issue.
- Go to the Crypto tab and turn on “Automatic HTTP Rewrites.”
Note: if you are using WordPress or Joomla then you may notice a mixed content issue and page might be broken. To fix that, you need to use an additional plugin as explained here.
- Go to speed tab and select the checkbox
Rocket Loader – Rocket Loader solution is a trademark of Cloudflare which does many things like reducing the number of requests, loading scripts asynchronously, caching scripts locally, etc.
- Under the speed tab, select Automatic for “Rocket Loader.”
The above essential configuration should be enough to accelerate.
Site load time after Cloudflare
I ran the test again with BlazeMeter and here is the result.
- Average response time – 609.3ms
- 90% response time – 628ms
You can see the average response time is decreased by more than 10% and a maximum (90% response time) by more than 25%.
Having web page load time decreased by using Cloudflare FREE plan looks promising. If you are looking for a quick win, you can give a try. Cloudflare does have a paid plan with more features like WAF, Image Optimization, Mobile optimization, etc.
If you are using WordPress then you may consider using WP Cloudflare Super Page Cache plugin which cache the entire sites (static + dynamic content) intelligently. This would further cut-down the page load time and improve response time.
What’s the alternative to Cloudflare?
A very strong recommendation would be to try Sucuri.