36

Finally I decide to use Cloudflare – here are why

 4 years ago
source link: https://www.tuicool.com/articles/eqI3yyN
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

I know and I do use Cloudflare service for client’s projects, for years. Yet, I am not really convinced to use them on my own blog because of several reasons.

Among those reasons, the one that’s most important is I don’t want to switch the nameserver to theirs. Several days ago, I do try it through the Cloudflare menu on cPanel. At that time, I did try to switch using CNAME but I was unable to figure out for the whole day.

I even open a ticket on my hosting dashboard onVeeroTech. Their supports are good and they’re trying to help me. But, since I don’t have any more time to tackle this, I decided to revert changes and close the ticket, then tell them that everything is ok for now.

Then, today I notice the trends that traffic from outside of North America regions are steadily growing. The most noticeable were from the EU and Australia.

Yet, at this point, I am aware that this blog will not be fast enough to serve users from those regions because it’s not using any CDN services. On the same time, I finally made up my mind.

Why don’t I give a try to set up Cloudflare once again? This time, I go through directly on the Cloudflare dashboard and switch the nameserver to point on CF nameservers.

It said it will take several hours to propagate. And I know that. Changing nameservers will take a least 24 hours to propagate on all over the world.

But, my thought was wrong. I checked several minutes later and I saw the nameserver is already propagated to CF nameserver. Cool.

The next thing I do is making sure all of DNS records (CNAME, A, MX, and others) are imported on CF DNS management dashboard. Once I am sure of it I did

  • Check the e-mail. Make sure the MX records are working and I can send and receive e-mail correctly.
  • Tweak the options on Cloudflare dashboard, which are available for free tier plan.
  • Turn off the Shortpixel CDN provided by Autoptimize plugin.
  • Open two other browsers: Chrome and Safari, clear up their caches and check the site manually to make sure nothing was broken.
  • Open GTMetrix, Google Pagespeed Insight, and Pingdom to do benchmark test.

GTMetrix score for Pagespeed and YSlow are now both A.  Google Pagespeed Insight tool also shows improvements for both mobile and desktop. Earlier, before using Cloudflare, the mobile score was around 65 and the desktop one was around 85. 

After using CF, the mobile score is 95, and the desktop one is 96. What a great leap in the score. Not only that, when I tested it using Pingdom from Australia location, the page loads in 2 seconds. Before the switch, it loads in nearly 4 seconds.

Ok, enough with the story. Let’s get into the reasons why you should consider using CF like I do.

Think of it as a guard

Yes, think of CloudFlare as a guard which protects your site’s server. In case something is attacking your site, CloudFlare which sits in front of your site’s server will handle the attack. Thus, the attacks won’t reach your site’s server.

I read many cases where a web hosting terminated the service for a site owner because his site was under attack. Since it’s a shared web hosting, usually, such an attack will affect the other customers too. And the company usually didn’t want to do anything except terminated the customer’s site that’s under attack to save the rest.

As a middle man

CloudFlare will cache your site. If there’s a visitor tried to open your site, CloudFlare will check if it had the cache on their side. If they had, then they will serve the request using that cache. This means the requests didn’t really touch your own server.

Save bandwidth

This can save e lot of resources. Remember that, even if your hosting company said your site bandwidth is unmetered  it doesn’t mean  unlimited. At some points, when your bandwidth usage crossed their maximum threshold, they’ll urge you to upgrade to the more expensive plan. Or, they will simply terminate the service for your site.

CDN

CloudFlare will give you a free CDN service, and serve your site from the nearest server from your visitor’s physical location. This is the key why using CloudFlare will help your site if its visitors are spreading around the world.

You can take a look on this map, to see those locations

Block the traffic based on user agent

You can block the suspicious traffic or bots based on the user agent. For a free tier plan, they allow up to 10 user agents to be blocked.

Analytics

CloudFlare provides us with comprehensive analytics. This is where we can see the requests that are cached by CloudFlare or uncached. Not only that, but there’s also an option to see the unique visitors and their county origin.

Free SSL

I know many web hosting now are supporting SSL certificate from Let’s Encrypt. However, in case your own host did not support it, you can set up CloudFlare and it will issue SSL certs for your site’s domain.

Even better, there are options to enable the HSTS (HTTP Strict Transport Security)  so the browsers will refuse to open your site if it’s not on https protocol.

With this, you can request your site’s domain for HSTS inclusion too. But before you did it, pleaseread this first.

Verdicts

There are still many advantages using CloudFlare, but I only listed the ones that are relevant to my case here. But, it doesn’t mean there are no drawbacks to use CloudFlare. There is one, as I notice so far: when they are down, your site will be down too unless you enable load balancing for at least $5/month.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK