Cloudflare Slows Down My Website Response Time ( Update: Because of HTTP/2)

I’m using a VPS plan and decided to use CloudFlare’s free service with the aim of speeding up my website. However, it turns out Cloudflare increases my server response time. In a previous article Cloudflare claims that they do not consider TTFB when it comes to a website’s speed but that is a wrong observation. I’ll explain here why.

TTFB simply means the time it takes the server to prepare the requested information by a website user and respond back. If TTFB takes longer, then most definitely, it will take long too to respond to a website visitor; hence, result to longer webpage loading time.

Here is the case of a website that I have on a VPS plan. When I’m not using Cloudflare on the webiste, the TTFB is approximately 250-300ms. The page load time takes around 1.5 seconds.

However, when I link the website with Cloudflare, the TTFB more than doubles to stand at approximately 600-750ms. The website load time takes around 2.0 seconds to load. Clearly, that shows TTFB matters and Cloudflare should take it seriously unless the free plan is designed to behave that way.

Cloudflare may have bad routing between your VPS and CF. Can you post a screenshot of https://cloudflare-test.judge.sh?

During that time magic just doesn’t happen.

Probably. That tool is telling me that my website is Likely not a Cloudflare website, or not proxied.

However, tools such as https://dnschecker.org/#NS/xnnxhd.com show that my site https://www.xnnxhd.com is pointed at Cloudflare

Can you check now please? Cloudflare shows that it’s proxied from my dashboard

Thanks for checking

try entering just xnnxhd.com, I haven’t fixed the issue where https:// in that box breaks the detection.

Also, just a screenshot of the page, even without your website specifically, would work.

There it is. If you need the whole page do let me know.

Since the second ping (that will use the kept-alive connection, so the pure RTT between your device and Cloudflare) is pretty low, the connectivity between CF and you is pretty good. The only issue that could be causing it is maybe either

A. Your server doing something different when it receives Cloudflare headers (unlikely) or otherwise does something else when CF is being a proxy for the visitor.

B. the routing between your hosting and Cloudflare is bad

In the case of B, Where is your hosting located, and if you’re comfortable saying it, what is your hosting provider? And if you have SSH access to your server, the output of tracert 104.18.38.191 would also be useful.

Is this via a website speed test service, or your local machine?

A speed test service. Used several and they all show almost similar results.

Hosting is located in Germany and the service provider is Contabo. For traceroute, can you give me a command for Apache?

If you can’t access the command-line of your hosting machine, a traceroute isn’t really possible. Your hosting control panel might give instruction for SSH’ing into your server, in which case you run traceroute 104.18.38.191.

Let me dig into the issue. I’ll give you an update.

Okay…found out my server’s firewall was blocking the request. Here are the details

@Judge - still waiting for your feedback bro

Since the routing is fine (4 ms to Cloudflare) it’s likely something with the web server doing something different when CF is requesting the page instead of a regular visitor. It’s hard to pinpoint what would be taking longer, but maybe benchmark your server with an APM solution or, if it’s wordpress, a “plugin profiler” like P3.

Hello I hope you don’t mind me adding on here, I wanted to say thankyou for the great tool and link :} it has helped me assess why (I think) load times vary so much on our new site under development on sydney servers.

for those reading this later, just use yourdomain.com no https:// and cut and paste yourdomain.com (as in yourdomain name) into the box provided at the link above to do a retest.

Fully loaded time varies by upto 100%. Using the tool I could see that the CF data centre was changing from Sydney, to Melbourne to Hong Kong on a number of tests over a 15 minute or so period., with ping results in the 10s to 100s in Sydney, upto 2500 in Melbourne and about 1500 in HK My guess is that as it is on the free CF plan the Australian centres were kickiing us off when busy. This morning I see it is more stable and is in HK around the 1000 to 1500 mark on first ping:

HKG

Hong Kong International

IPv4

http/2

First ping: 1431

Second ping: 168

This is not ideal obviously and I have a question if I may?
We plan to move the site onto the Google Cloud. It is my understanding CF is integrated with GC. Am I right in thinking that we will not have this problem using GC & CF? and the site ttfb should be very quick?
Do you know at what sort of traffic figures we should be looking to move up to the paid pro CF version… are there other reasons to be on the pro plan whilst traffic is very low?.. so we can plan ahead

Thanks again for the great tool,
Kind Regards,
Rock

After days of tweaking my servers, I decided to cross-check with other sites on Cloudflare on why their TTFB is fast. I did find that the sites were not using Cloudflare’s HTTP/2 feature. Instead, the tests, which can be done using any page speed tools, reveals their HTTP/2 pointed directly on their servers.

I disconnected Cloudflare and tested my site and in deed the TTFB is very fast on my server that already has HTTP/2 enabled. However, when checking my Cloudflare account to disable the TTFB, I realized that it’s a paid feature, meaning Cloudflare is aware about it. I mean, HTTP/2 looks like a premium feature not to offer for free but in this case, it’s enabled and locked on the free account.

Another forum post, someone noted the same too here

That said, I think the best Cloudflare features that will make me foot the $20 bill are the security features, and fast ping times for redirects, DNS, server connect speeds, SSL, and server send requests. I will upload the test results for better illustration.

This topic was automatically closed after 30 days. New replies are no longer allowed.