Reduce TTFB on PHP empty file

725 views Asked by At

I have trouble reducing TTFB on PHP.

Even when file is empty it needs about 100ms. It doesn't matter .php or .html, both need the same time.

I have a decent server on HETZNER, server is not loaded and shoudn't have any problem.

Can it be problem with Cpanel?

Is it possible to have lower TTFB on php 7.0 (empty file)?

I managed to reduce connect time by changing DNS Server from hostgator (LaunchPad) to cloudflare (it was about 100ms and now it's ~1.5ms).

Any suggestions?

1

There are 1 answers

5
Krzysztof Czerwiński On BEST ANSWER

TTFB depend on network latency.

I've just performed a test on my web application I'm developing. The chrome TTFB analyze on my test server showed 225ms on my LTE connection, and the same application runs on my computer apache server has 14ms TTFB in chrome. The ping test to my local machine shown 0.015ms latency, and the server 64ms latency. This is probably why your TTFB cannot be reduced under 100ms. It's rather your network connection latency and not the application. Try to perform the test on very fast connection or use apache ab to test it on the server console.