Help Improving TTFB.

My site TTFB is too high. The page document is in “waiting” or “pending” for 4-5 seconds. then it loads page contents 1-2 seconds. https://cdn.livechat-static.com/api/file/lc/att/8801096/6e831140ea06cf1dc50a0b6ad50999aa/Capture.PNG
https://cdn.livechat-static.com/api/file/lc/att/8801096/47e825a596129e47b299a614e2e8b71e/Capture.PNG

I upgraded to gold but not much difference, it is still showing 3-4s. Please check and help.

  • Ben
    • Design Lord, Child of Thor

    Hi Dimitris, Thanks for the reply.
    Since yesterday we have seen TTFB from 19secs to 10,5 and now 2secs. This is great.
    The sites in question are our subsites.
    Toatal page load times are now about 3 secs of which TTFB accounts for 2 of those 55%-65% on average.
    When inspecting with hummingbird the two main Suggestions are “Render blocking resources (37/100), which we can improve easily ourselves and “Reduce initial server response time” (0/100) which I cant click on.
    I was hoping, since content from our pages are being loaded in well under 2 secs, that we might be able to address the 0/100 server response time and that this may improve the total page load since it accounts for the majority of total wait time.

  • Pawel Pela
    • Ex Staff

    Hello Ben !

    Hope you’re having a great day!

    As for the differences in TTFB between checks, here’s some notes on that:

    1. It’s important to run the checks in incognito mode or in another browser as when you’re logged in, the caching is disabled by default. So you will get the results without caching in this case which are usually higher than the cached versions.

    2. Please make sure the cache isn’t cleared too often. There are settings in Hummingbird that allow you to set cache clearing on some actions (updating posts, comments and you can also set up cache clearing on interval). In this case the page load time may initially increase until a new cached version of the page is created. That happens on first visit of the page while not logged in. I usually run a couple of checks in a row to see if the results are similar of if they vary between checks.

    The important issue here is that if cache is cleared too often, it won’t have time to populate between visits.

    This may also happen if one of the plugins triggers a cache flush using the default WordPress function. This is a different cache than Hummingbird’s, as this function clears the server-side Object Cache. It’s usually highly discouraged to use this function in plugins. You can read a bit more on that here: https://chandrapatel.in/wp_cache_flush-think-twice-before-using-it/

    I’ve run some checks on your site, especially on the template subsite. The initial TTFB was ~1-2 seconds, however on subsequent reloads it dropped to 300-700ms, which is in the correct range.

    I did additional checks on the server, using WP-CLI commands that check for things like too many options being autoloaded (it’s okay in this case, way below the threshold for any warning) – which could increase response times.

    I checked also for the usage of wp_cache_flush function and found the following plugins using it:
    – Elementor and Elementor Pro
    – WooCommerce
    – Hummingbird (here we know it only clears the Object Cache if absolutely needed and if the appropriate option in Hummingbird >> Caching is set)
    – WP Ultimo

    So it’s possible that the variations in the results on TTFB may be caused here by one of the above plugins clearing the Object Cache too often.

    Possible ways to test that in WordPress include:
    – running a plugin test (disabling the plugins in question and checking if the TTFB is still varying considerably)
    – checking with the ObjectCache disabled – you can do that on our staging site, as it doesn’t have Object Cache enabled. Please note though that the staging environment has less resources than the live site and the TTFB will probably be higher there. In this case I’d only focus on checking the variations in TTFB between reloads.

    Hope this helps!

    Kind regards,
    Pawel

  • Ben
    • Design Lord, Child of Thor

    Thanks for the extensive test Pawel.
    Please excuse my ignorance, but how does any of this affect TTFB?
    I understand that caching will improve page load speed, but that’s not the problem, Caching is working very well.
    The problem is the response time from the server.
    I have tested as you requested above, but they all take the same time to start loading.
    Unfortunately, I cant seem to get that below 2secs TTFB for any pages. even small pages with no content.
    In fact one of the plugin developers we use, sent me an email after trying to test some changes to show his concern about the delay in our TTFB. He asked us to enable opcache and memcache, which I had to inform was apparently, already configured with WPMUDEV.

    How do we address the below?

    When inspecting with hummingbird main Suggestion is:
    2/ “Reduce initial server response time” (0/100) which I cant click on.
    I was hoping, since content from our pages are being loaded in well under 2 secs, that you might be able to address the 0/100 server response time and that this may improve the total page load since it accounts for the majority of total wait time.

  • Prathamesh Palve
    • Tech Support Team Lead

    Hello Ben ,

    To reduce the initial server response time is to reduce the time to load the first byte. As Pawel mentioned, that needs to be worked on. Now there are too many factors which are to be considered while working on the TTFB:

    1. Server issue (rare)
    2. Caching not configured properly( Pawel did make a mention about this too)
    3. Multiple caching plugins (not the case here but many plugins having functions to flush cache)
    4. Not using image and Asset CDN’s
    5. Too many plugins or Some plugins taking a bit of time to reply on(this could be the case too)

    What you can do on your end now.
    I. Install Query monitor plugin and check which plugins take a bit of time to load :
    https://wordpress.org/plugins/query-monitor/
    II. Then disable the one which is suspected and check if things look good to you

    Should you need help in doing this or you get stuck in between, please reply in the thread here and we would be happy to help you further.

    Regards,
    Prathamesh Palve