The famous TTFB is confusing me.
What exactly describes it, the first byte of my HTTP response or the first byte of underlying protocols like TCP?
You can often read that gzipping your content could lower the TTFB, but why? Zipping means more CPU load on the server side which should result in a worse TTFB or am I wrong here?
The time of “flushing” content seems to be important, but I have trouble finding more information on it. How can I influence the flushing, e.g. on a PHP based webpage? Is it a simple setting/configuration of the server or is it just the location in my code where I perform my “echos” ?
Thank you
TTFB is the delay between the end of a request and receiving a response, as we’re talking about the web here it will be when the browser received the first byte.
Gzipping the content will increase the TTFB slightly but provided the server isn’t overwhelmed the it should be a negligible delay.
What gzipping does is reduce the overall time to download the content.
Normally a server won’t send the page to the browser until the whole page has been generated, what flushing early does it return some content to the browser so it can process is and start downloading and files referenced sooner.
A good explanation of early flushing starts at slide 51 of this talk – http://www.slideshare.net/profyclub_ru/progressive-downloads-and-rendering-stoyan-stefanov