phpmagentoserver-response

What can delay "Time to First byte" by almost 2s?


I have enabled a PHP profiler, well magento, but it is still a profiler. This is the standard magento compiler that records all the processing including all db queries to create the page, from receiving the request.

mage-profiler

I am testing with a the php built-in server hosted locally.

The results show pretty decent server response times, but on the chrome developer tools the Time to first byte is much higher. Why is this?

Take Note...the screenshots below of the timings are from the SAME REQUEST...CLEARLY

Profiler (www.mysite.com/index.php):

magento-profiler-server-response

Developer tools (www.mysite.com/index.php):

TTFB-chrome-developer-tools


Solution

  • Found the issue.

    The profiler is not recording included libraries. In the magento/lib folder nothing is recorded even if you explicitly set it to profile.

    It seems that we need to use an all-encompassing php profiler