Cloudflare's impact on performances
I was hoping that moving to Cloudflare would improve my site loading speeds and solve a bot problem I had, but it did neither.
After moving to Cloudflare, the site immediately went down with this error:
ERR_TOO_MANY_REDIRECTS Cannot follow more than 20 redirections.
I had to change the Cloudflare SSL setting to "Full (strict)" to resolve the redirect loop and get the site back online.
PageSpeed Insights and GTMetrix Benchmarks
I ran PageSpeed Insights and GTMetrix multiple times and averaged the results. The outcome was quite disappointing. The only improved metric was LCP, which improved by ~11.6%. Most metrics stayed the same, but a few worsened: more blocking time, worse score on best practices, and worse structure score.
Pagespeed Mobile
Metrics | Namecheap DNS | Cloudflare DNS | Change |
---|---|---|---|
Performance | 64 | 64 | 0.00% |
Accessibility | 88 | 88 | 0.00% |
Best Practices | 100 | 83 | -17.00% |
SEO | 92 | 92 | 0.00% |
Pagespeed Desktop
Metrics | Namecheap DNS | Cloudflare DNS | Change |
---|---|---|---|
Performance | 99 | 99 | 0.00% |
Accessibility | 88 | 88 | 0.00% |
Best Practices | 100 | 100 | 0.00% |
SEO | 91 | 91 | 0.00% |
GTMetrix
Metrics | Namecheap DNS | Cloudflare DNS | Change |
---|---|---|---|
Performance Score | 97.50% | 97.50% | 0 |
Structure Score | 97% | 96.50% | -0.52% |
Largest Contentful Paint | 873ms | 772ms | -11.57% (improved) |
Total Blocking Time | 90ms | 113.5ms | +26.11% (worse) |
Cumulative Layout Shift | 0 | 0 | 0 |
Real-World Performances
So far it hasn't been worth it performances-wise, let's check out UpTime Robot that visit my site every 5mn. The speed is usually pretty stable:
Same story. Not only are all the measurements for the last two hours above average, the min measurement (690ms) is larger than the previous max (664ms) over the period.
The effect is small, but I expected a boost in speed, not a penalty.
A day later, the average response time 662.08ms, the website is 7.8% slower on average:
Wrap up
Migrating to Cloudflare produced these results:
- No improvement in most performance metrics
- Mobile Best Practices score: -17% (worse)
- Total Blocking Time: +26.11% (worse)
- Structure Score: -0.52% (worse)
- Real-world response times: +7.8% (worse)
- Only improvement: Largest Contentful Paint -11.57%
That was surprising because the issue was called "Move to Cloudflare w/ the hope to improve performances", so it clearly did fail in that aspect. Now, that are the metrics I could track. There are plenty I couldn't. Maybe in the future there is a DDos attempt against my website and I don't even notice it because cloudflare saves the day. Maybe at high traffic times, or in remote parts of the world, the CDN will help, but out of the box, in normal conditions, it hurt perfromances a bit.