I'm running a Wordpress ecommerce website on a dedicated VPS with 4CPUs and 6gb RAM, so resources are not an issue . On top of this I have VestaCP installed, with a Nginx + Apache + Php-FPM server . Also using clouflare caching together with WP Rocket, which have worked together the best out of all tests so far .
After deploying the website in question I have been struggling with unbearably high TTFB times which account for around 2.5seconds average from multiple locations I have tested using KeyCDN .
So I made a new fresh wordpress install and realized that even though my TTFB still isn't the best, I could reach around 400 to 500ms average from multiple locations .
This allowed me to rule out the possibility of having a bottleneck at the server side so after a bit more debugging and installing Wordpress Query Monitor, I realized the total number of calls being done to the database only accounts for 0.09 seconds, so the database also does not seem to be an issue unless it's causing a huge delay even before the first query after TTFB ends runs .
Another thing I have done was to disable every plugin but that also didn't seem to help much, perhaps it took 300ms or so to the total loading time during the wait (TTFB) .
I feel a bit lost here and at this point am not sure what else I could do in order to debug this or what might be causing it .
Even though the db queries are running fast it still feels as it's the database that hangs for a while before the website starts loading .
Would really appreciate some insights on how to further debug this issue and how to rule out the database as a bottleneck .
Thanks
After multiple setups , tweakin caches, databases , CDN nothing work until I installed a Nginx + Php-FM + Redis Cache stack together with redis cache plugin for wordpress.
I have to say I am very impressed with the results and I don't think I have ever seen a woocommerce website with such a low TTFB .
TTFB went down from 2.5 sec to 60-120 ms !! Insane increase in performance :)
If you ever find yourself struggling with high TTFB for wordpress, give this setup a try, it's the best thing I have ever done for a wordpress website .
Furthermore, it doesn't need a cache plugin to work !
You can try calling all assets from the footer, optimizing images and activate lazy loading. I need to look at gtmetrix data to help me in more detail.