Troubleshooting my TTFB

Joined
Aug 10, 2015
Messages
79
Likes
107
Degree
0
ATM the TTFB on my site looks like this (tested with Google PageSpeed Insights):
  • homepage: 2,97 s (mobile)
  • biggest category: TTFB 2,1 s (mobile)
  • blog post 1 (heavy on video's): TTFB 2 s (mobile)
  • blog post 2 (regular, mainly text): TTFB 2,33 s (mobile)
Yes, that's seconds. It's f*cking horrible and I'm trying to troubleshoot what's causing this so I can improve it.

My current setup:
  • WordPress (latest version)
  • Cloudflare (free account)
  • Siteground web hosting, StartUp plan (cheapest plan, see here)
  • Speed plugins: Autoptimize + Async Javascript
  • It's a niche site, classic aff + ads
I've heard/seen talk that the free version of Cloudflare causes a massive increase of the TTFB because of how they operate (firewalls, filters, etc. for security). It's also easy to assume the cheapest hosting plan sucks, but I'm still wondering how to move forward:
  • Pay for Cloudflare + upgrade hosting with Siteground?
  • Pay for KeyCDN, remove Cloudflare + upgrade hosting with Siteground?
  • Move to Kinsta (including KeyCDN)?
What will get me the biggest gains? Any thoughts?

P.S. Keep in mind that the site currently earns between 10-50 euros a month, depending on season. This has me thinking things like a VPS is not worth it yet but I might be wrong here...
 
  • Siteground web hosting, StartUp plan (cheapest plan, see here)

That's about 90% there is to it. Going from a shared hosting like yours to a VPS will do wonders to your TTFB, especially if you choose the right VPS provider.

Having said that, you shouldn't even be worrying about that right now. A site that generates 50€/mo has bigger problems than page speed. Focus on content, links, social promotion, on-page SEO over anything else for the time being.

You can focus on speeding it up afterwards. Something I would look at though is where your target public is located. If you're targeting the USA, and your current server is in the USA, there's no need for Cloudflare. If you're targeting the USA, and your current server is in Europe, ask Siteground if they can move you over. Removing the free Cloudflare plan could help you gain a bit of time.
 
You could use amazon's cloudfront for a no-frills cdn. They also have lightsail servers at rock bottom rates
 
I agree with you and mrodriguez27 that the problems are most likely: That low-power shared hosting and using the free Cloudflare. I'd axe the Cloudflare regardless unless you're operating across the ocean like mentioned before. It'd be better to get a server there than to use a CDN, especially a free one where your job is to gather data for the paid clients.

Doing those two things would make a difference, for sure. From there you have to make it easier for the server to send the first file. That's all this is about, it all occurs before all other speed optimization stuff. That's always the source code for the page, and even if you're running a flat file operation the server has to compile the PHP (grab the header, grab the footer, grab the sidebar, get the body, mush it together). In the case of using a database, it has to query the database with MySQL on top of PHP.

You can probably see where this is going. You need server-side caching, and since you're using Wordpress that's simple. I recommend WP Super Cache for 99.9% of sites. You can enable it and the settings will be, by default, set up optimally for most cases. If you had an edge-case on your hands you'd know.

Your server has to react quickly (not cheap shared hosting / not free tier CDN), have enough free resources to do that (not cheap shared hosting), and have to do the least amount of resource gathering as possible (you need server-side caching).

That's pretty much all there is to it. Most of it is in the hands of the server company but you can opt to not use their worst-tier flavor. Not sabotaging yourself with a CDN helps. And then you can help the server by helping it cache.
 
Cloudflare is usually pretty quick, those blog posts you are reading are likely old.
Just checked one of our sites, WordPress on shared hosting, behind cloudflare. Pagespeed insights says TTFB under 80ms. I checked a similar site that's not behind cloudflare, and got 50ms TTFB, so there IS a difference, but it's insignificant.

Your hosting could be overloaded, but it's just as likely a slow theme/plugin combined with a lack of cache.

Install WP fastest cache, enable it, and then check again.
 
After the feedback here, I made some changes and here are the results:

MetricBeforeAfter
Average TTFB
Source: Google PageSpeed
2,28 s
82 ms
Average FCP
Source: Google PageSpeed
4,08 s
4,20 s
Average load time
Source: Pingdom
5,03 s
1,32 s
Average # of requests
Source: Pingdom
120
85

To get these results I upgraded my hosting, removed Cloudflare, set up WP Rocket and made around a dozen small tweaks to the code/theme I'm using.

It's also having an impact in other ways: bounce rate is down ~10% and daily AdSense income almost tripled!!

All in all, I'm happy with these results and now it's time to get back to content & links!
 
Very good improvements. Are you caching HTML? In many cases, you can, and you won't have to hit the database for every request. For a regular Wordpress site, where content doesn't change that often, it might be a good idea - and then your hosting will matter less for page speed.

From my experience, TTFB is higher on Cloudflare - since they proxy the request, and fetch the page from the origin server. But, I *think* you can also do edge caching of HTML on their free plan.

Generally, the overall page load speed (but not TTFB), is improved when I run Cloudflare, and it has some neat features.
 
Very good improvements. Are you caching HTML? In many cases, you can, and you won't have to hit the database for every request. For a regular Wordpress site, where content doesn't change that often, it might be a good idea - and then your hosting will matter less for page speed.
Yes, I'm caching HTML now.

Generally, the overall page load speed (but not TTFB), is improved when I run Cloudflare, and it has some neat features.
They do have some neat features for sure, but like @mrodriguez27 rightfully pointed out, it's about where my target audience is located. I'm targeting one country only and my server is located there, so I'm getting more benefits from not having Cloudflare than from having it right now.
 
Back