Live data from Hacker News

Stop worrying about Time To First Byte (TTFB)

blog.cloudflare.com

31–38 of 38 posts

Re: Stop worrying about Time To First Byte (TTFB)

#31

There's an important optimization that Nginx is missing around real-world TTFB, however that would benefit Cloudflare users. Even though it is streaming compression, zlib normally packs compressed content into larger than 1500-byte blocks. Browsers can start parsing gzipped content as soon as they can decompress a block, but they have to wait for a whole block to arrive, which means for gzipped content they will ofte…

Thanks for that suggestion. I will look into altering nginx to do that.

Re: Stop worrying about Time To First Byte (TTFB)

#32
post #7

Earlier quoted context omitted.

That's exactly their point. They claim most measurement tools will give false results if your web server outputs the headers before processing the actual request data.

In other words, web servers can cheat and look good, so we should just ignore TTFB. If you're not a web server developer, TTFB is quite useful. It tells you how quickly request processing happened. Progressive images can get started quickly. The problem is not with TTFB -- it's that tests that succeed even with "cheating" header responses need to be fixed, if possible, to fail the cheating server. WebPageTest could m…

But sending the header first isn't cheating. What you need to do is wait for the first byte of actual page content to show up. That will show you how long initial request processing took.

Re: Stop worrying about Time To First Byte (TTFB)

#33
post #25

"At CloudFlare TTFB is not a significant metric." People might think that this article is written to educate masses. The thing is - if you take webpagetest.org and run speed tests with and without Cloudflare, in MANY cases 'Load time' will actually be slower WITH CloudFlare. And the biggest difference will be in TTFB. Why does it happen? Cloudflare works as a proxy, taking HTML from your server and returning it to a…

The hop is not the problem. In fact, an extra hop can actually be a benefit, due to various TCP and connectivity factors. The issue might actually be "CloudFlare buffers all the content and does complex operations on it before returning any of it", or maybe is simply a poor CDN (not really being very distributed, for example).

For more information, see a long comment I wrote on this a while back (note: while reading, remember that a CDN typically has a server very near the end user but not so near as to be on the other end of the last mile of their network connectivity; in essence, they are a reverse proxy solution positioned in the network where a forward proxy would normally go), as well as the response someone left:

http://news.ycombinator.com/item?id=2823268

Re: Stop worrying about Time To First Byte (TTFB)

#34

Completely ignoring TTFB would be a BAD idea. There is no single metric that conveys the user experience (or performance). Certainly optimizing for 1ms because of the overhead for gzip compression isn't where you should be spending your time but I have dozens of cases in the WebPagetest forums where users have had 5+ second TTFB times and needed help figuring out what was going on. I have even seen cases where it was…

    > There is no single metric that conveys
    > the user experience (or performance)
True. But if you need to pick one, TTFB isn't as good as something like Speed Index [1]. Getting your TTFB down will usually help you get your content in front of the user faster by, as you say, giving it a head-start on external resources, but that will also show up in the Speed Index.

[1] https://sites.google.com/a/webpagetest.org/docs/using-webpag...

Re: Stop worrying about Time To First Byte (TTFB)

#36

This is just silly. Time to first byte does matter , when you know what to put in those first bytes. https://plus.google.com/114552443805676710515/posts/GTWYbYWP...

Your post explains time to first full packet. Yes that matters, not the first byte.

Re: Stop worrying about Time To First Byte (TTFB)

#37

This is just silly. Time to first byte does matter , when you know what to put in those first bytes. https://plus.google.com/114552443805676710515/posts/GTWYbYWP...

I've replied on G+ but I think it's worth pointing out that I don't disagree that time to the first useful byte matters. The issue is that what's being reported isn't that and the time of header generation is not dependent on the time to the first useful byte (as the gzip example indicates).

Re: Stop worrying about Time To First Byte (TTFB)

#38

I'd guess this minutiae was written in response to some unreferenced critique of their service, in reality nobody with sense would use TTFB as a useful measure of application performance. In fact measuring performance anywhere near the HTTP layer is often pointless when such metrics are so disconnected from what a user actually experiences. Perhaps a better test would be something like "perceptible latency", taking i…

I'm shocked at how Cloudflare is downplaying the importance of TTFB just because their service happens to INCREASE them.

What I would have liked to see was them showing commitment to how they will be IMPROVING the TTFB.

I love Cloudflare but seriously, saying TTFB is not important is just non-sense. Whoever says TTFB doesn't mean anything either doesn't know what they are talking about or they just buying into the hype of cloudflare/cdn services.

Take a look at a "typical" magento store for example: http://www.hybrid-racing.com/store

It has a 1.5 TTFB. This site is slow and no matter what CDN or WPO (front-end optimizations) you do, it will always take 1.5 second page to page.

Only way to speed up this site is switching over to faster hosting, something more preferable like linode's SAS 15K5 RAID10 hosting and/or perform some caching (e.g; full-page caching via varnish).

Post reply on HN