Chris1904
By:
Chris1904

TTFB is very long using Cloudflare

March 11, 2017 1.8k views
Big Data Ubuntu 16.04

Hi everyone!

The issue I run into is that when I upload files I chunk them into smaller pieces. After each chunk a new request gets sent. These requests have a long TTFB waiting time as you can see here:

screenshot

It takes 1.2 mins to upload 50mb and then 30 seconds to respond from Cloudflare to my server in order to start the next 50mb chunk.

Is there a way I can disable Cloudflare for http://testnow.ga/jquery-file-upload only and not for http://testnow.ga/ ?

I would appreciate any help!

4 Answers

@Chris1904

I'm not sure if this is possible on the pay accounts, though it's not possible to disable specific URL's on their free accounts.

The only way around this that I can think of would be to setup a sub-domain, disable that sub-domain within the CloudFlare control panel (you'd still need to set it up so that they're aware of it), and then use the sub-domain to access your upload script.

Thanks for the response! I figured it would only be available through subdomains. I wish that would be a possibility on my end to set up a sub domain. :-( Seems like I just need to do some better caching on my end. Shouldn't be too hard and on top of it all the popular libraries are available as CDNs anyways.

@Woet
Thanks for that post but it doesn't affect my case, because I am uploading data which seems to be processed on Cloudflare's end. It is not meaningless as they say, when it adds an extra 7 minutes of waiting when the user is uploading a 300mb file. Other than that I do agree with them if it does not hurt your SEO.

  • Have you ruled out your server taking a while to process the upload instead of CF?

    • Yes, I have. It is not the server's fault, due to it running just fine on a minimal TTFB without Cloudflare.

  • @Chris1904

    The only real take-away from that post applies more so when you're TTFB is already extremely low, thus trying to minimize it further becomes micro-optimization which is really unnecessary unless we're talking mission-critical. TTFB does play a role, whether or not you worry about it as much as others do depends on your application(s) or circumstance(s), as well as what your TTFB actually is.

    If you're running 0.1-0.5s TTFB, it's really a non-issue. When you're running 2-10s+, it's very much an issue and CloudFlare isn't going to help that. It'd be server/network related before it even touches CloudFlare and then CloudFlare overlays on top which adds to it.

    That said, when it comes to CloudFlare, it's pretty known (and mentioned in that same post) that in many cases, the TTFB is going to be a little if not a lot higher than it would be if you ran solo (your own server). In most cases, I see better performance without CloudFlare than I do with it, but with it there's much to gain that would otherwise be a little more complex (but not 100% impossible) to do without it.

    As for the Page Rules, it looks like the only disable options you can put on a URL are apps, performance, and security. I'm not sure if that 100% disables CloudFlare on the URL the same way it would if you simply turned CloudFlare off for a sub-domain, but it's worth a shot. If that doesn't work, the sub-domain route will, but you'll need to set that up.

Have another answer? Share your knowledge.