Hello to all with Magento Knowledge,
I have run in to an issue with my new project running magento 2.2 with regards to what I believe to be a Time till first byte delay of which is only affecting my homepage.
I am running my magento store via Managed Cloud Hosting package. My store is set to use varnish cache and I receive great speeds on all pages of my site except for the homepage.
There appears to be a delay / server wait period of 3 or more seconds depending on when running the speed test and I can't see this issue having effect anywhere else on the site.
I had a previous application running the same site template which I still have access too which does not have such delay on any part of the site.
Could any one please point me in the right direction to reduce this server wait time please. I could not use the previous app as a final site as I was experiencing ongoing issues with Web Setup Wizard in that build, but this time its just the few seconds delay that's the problem everything else is fine, I do see this is as quite significant in terms of client satisfaction when using the site so I would really like to get it resolved as soon as possible.
Thanks in advance.
We'd recommend to enable profiler and take a look what exactly takes 3 seconds (maximally): https://community.magento.com/t5/Magento-2-x-Hosting-Performance/TTFB-issue-only-affecting-homepage-...
Here's a link to profiler: https://magento.stackexchange.com/questions/49000/magento-2-is-there-a-profiler
This module improves profiler: https://github.com/vpietri/magento2-developer-quickdevbar
It is likely that there is a 'complex' block on the main page, which possibly loads the heavy collection or something of the kind. It must entirely come from the full page cache. Make sure to check this first as well.
There is also a chance that 3rd party extension block is used on the main page, which 'disables' full page cache.
Take a look here to learn more: https://magento.stackexchange.com/questions/92923/magento-2-what-determines-if-a-request-is-full-pag...
Nore details about cache are here: http://devdocs.magento.com/guides/v2.0/config-guide/varnish/config-varnish-final.html. You can learn there how to check what actually works on that page.
Header 'X-Magento-Cache-Debug' with HIT value means that the page entirely came from the full page cache. You can check it out right in your browser (developer mode must be enabled!).
Something like that: https://gyazo.com/da6b101f9a425c1d86fde6e4e71cfa29
You might also want to take a look at this article to learn more about the full page cache: https://alanstorm.com/magento-2-full-page-caching-code-points/
If you've found one of our answers useful, please give 'Kudos' or 'Accept as Solution'.