GTMetrix Reduce initial server response time

Since the new GTMetrix update, I’m continually getting the [Reduce initial server response time] error. I understand there is a lot of other optimization I can go trough, but I don’t struggle with them but with this problem exactly. Can someone please give me a hint how can I optimize the speed for “ Reduce initial server response time ”? Thanks!

Reduce initial server response time Root document took 780 ms
Keep the server response time for the main document short because all other requests depend on it.

Learn how to improve this

They have have changed their algorithm, but that’s TTFB. You can read through a bunch of TTFB posts here for info on that.

The thing is I did. So far no luck. This is exactly TTFB. Most topics get closed in a few days and the answers are just not useful.

The top search result for TTFB using the :search: icon above is HIGH TTFB Siteground + Cloudfare … if that answer isn’t useful you might need to hire a professional to resolve it. I’m not sure what @eva2000 charges per hour (I imagine it’s in the $350US per hour range at least) but I’d hire him if I needed optimization beyond the advice he provides for free.

2 Likes

Thanks for the suggestion, but it’s funny. If I remove Cloudflare, I get way faster TTFB (a 50% improvement, to be exact). Since I’m using the free plan, I’m asking for a free solution. Otherwise, I’d pay for a decent CDN provider, and that would cost much less than $350 per 5 years. The moment I remove Cloudflare, I receive a 50% improvement in the TTFB. I read the topic you suggested, and I’m interested in reading more useful answers.

TTFB speed is relative so if your origin web server is located further away from test location then TTFB is higher and vice versa.

This is due to Cloudflare not caching HTML content by default (see below). So for optimal TTFB speed, you want your origin real web server to be hosted in a location closest to your majority traffic visitors and then put Cloudflare in front. For instance, my forums has 50% US visitors 40% Asian visitors and 10% Oceania. So my optimal geographic location for my origin is US West Coast as it sits in middle of US, Europe and Asian so equal round trip times for majority of visitors.

Cloudflare cache certain static content https://support.cloudflare.com/hc/en-us/articles/200172516-Which-file-extensions-does-Cloudflare-cache-for-static-content- but not dynamic/static generated html itself by default (which is what WPT TTFB is testing for). But you can tell Cloudflare to cache dynamic/static generated html content to some extent depending on Cloudflare plan you’re on via cache everything page rule but have to be careful to only do this for static html content and not dynamic html content (otherwise you would cache private logged in user content).

Then on CF Business plan you have access to Railgun which allows you to accelerate dynamic generated html content for the logged in users https://www.cloudflare.com/website-optimization/railgun/.

Then there’s also Argo for optimising the routing to your origin as well https://www.cloudflare.com/products/argo-smart-routing/

Older thread cover some of the page speed metrics at Performance Tutorials - Google PageSpeed & Webpagetest.org

And newer guide I wrote outlined for Google Lighthouse/Pagesped Insight for my Centmin Mod community users which is same engine GTMetrix has switched to at https://community.centminmod.com/threads/google-page-speed-insights-and-google-core-web-vital-metrics.20735/

To fully optimise you need to optimize 3 segments.

  1. segment 1 - connection between visitor and CF edge server i.e. CDN cache, WAF, Firewall, Page Rules, Mirage, Polish webP, HTTP/2, HTTP/3, CF Workers (i.e. custom/advanced caching) etc
  2. segment 2 - connection between CF edge server and your origin i.e. Argo, Railgun & Full SSL/ECDSA SSL certificates, pre-compressed asset served from origin
  3. segment 3 - your origin server’s performance/optimisations i.e. web server, PHP, MySQL server optimisations and server hardware specs.

Cloudflare can only help for segments 1 & 2 for cached guest/non-logged based visitors will easily scale. Now for Cloudflare CDN cache miss/bypass and logged in user for web apps like forums/wordpress, performance will be determined by segment 3. Which is the default with Cloudflare as dynamically generated HTML pages aren’t cached by default so cache miss means, whatever performance you have is measuring your origin server’s response time.

Wow you actually nailed that ballpark rate nicely with your guess :smiley:

4 Likes

Caching the content on the origin server could also improve TTFB, as explained here: https://wordpress.org/support/article/optimization-caching/

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.