Boost the performance of your website with Cloudflare

Michal Chylik
UFG news
Published in
3 min readMay 25, 2021

IT department in our company was looking for solution to prevent unverified bots from scraping our website. After quick research, we identified Cloudflare as the most suitable solution to our problems. But little did we know how much more Cloudflare can offer us…

Source: cloudflare.com

Fighting bots is quite easy with Cloudflare. Their Pro plan (which costs 20$/month per domain) offers WAF (Web Application Firewall) with many predefined settings and possibility to create custom rules based on one of more than 15 fields like Referrer, Cookie, URI etc.
You can also set exceptions for chosen bots (by defining IP, ASN, Country) to allow them access to your website.

This plan offers interesting tool named Super Bot Fight Mode. Using this mode you can Allow, Block or Challenge (Captcha) bots which are divided into two groups by Cloudflare. Verified bots should be the “good ones” and we allowed them access to our website. Then there are bots identified as Definitely automated. These bots are supposed to be “bad ones” or simply not recognized by Cloudflare. We decided to display Captcha to them so in case of human traffic wrongly recognized as definitely automated, visitors will still be able to access the website.

Dashboard for Super Bot Fight Mode

Unfortunately, it looks like there is no possibility of knowing how many Captchas were successfully solved. Therefore, we do not know, how many real visitors were bothered by this setting.

Be sure to recognize all the custom services which need access to your website and create an exception for them in Firewall rules or IP Access rules.

Once we set up the firewall, we started to explore other features that Cloudflare offers. We recognized Cloudflare as CDN provider but didn’t have experience with other options it offers to boost performance of a website. And there are plenty of them. To name the most interesting:

  • Polish improves image load time by optimizing images hosted on your domain. Optionally, the WebP image codec can be used with supported clients for additional performance benefits. We turned it on with lossy compression. Works perfectly.
  • Brotli compression format, which is faster than widely known Gzip.
  • Rocket Loader™ improves the paint time for pages which include JavaScript.
  • Possibility of using HTTP/3 (with QUIC)

Keep in mind, that to be able to use all the improvements offered by Cloudflare and its firewall, you have to use Cloudflare as proxy for your website. It also means that Cloudflare caches everything that is served as static content from your domain.

More than 75% of requests don’t hit your website

There can be static resources on your website that you do not want to cache. Fortunately, you can write custom rules to bypass cache.

And what about real world results of the changes described above? We implemented them on one of our e-shops built on Magento which had serious performance issues. We didn’t change a thing in our application. And the results were beyond our expectations.

Can you guess when the changes were implemented? :)

This article isn’t sponsored by Cloudflare even though it can look like it is :) But I wanted to share our experience with other website owners out there, who can also boost the performance of their website almost instantly and with minimal cost.

--

--

Michal Chylik
UFG news
Editor for

Tech Lead always keen to learn and write about new technologies.