# Time To First Byte and proxy\_buffering

**URL:** <https://www.ruby-forum.com/t/time-to-first-byte-and-proxy-buffering/213137>\
**Category:** NGINX\
**Created:** [October 25, 2011, 12:17am UTC](https://www.ruby-forum.com/t/time-to-first-byte-and-proxy-buffering/213137 "2011-10-25T00:17:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [October 25, 2011, 12:17am UTC](https://www.ruby-forum.com/t/time-to-first-byte-and-proxy-buffering/213137/1 "2011-10-25T00:17:25Z")

</div>

Hi all -

Does “proxy\_buffering on” (especially when it’ll definitely buffer to  
disk) imply that the client will _not_ be sent the first part of the  
response until nginx has received and buffered the entire response  
from the upstream server? Or does/can the upstream response buffering  
happen in parallel with the client-side response being sent?

## Many thanks, Jonathan

Jonathan M.  
London, UK  
[http://www.jpluscplusm.com/contact.html](http://www.jpluscplusm.com/contact.html)

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [October 25, 2011, 12:54am UTC](https://www.ruby-forum.com/t/time-to-first-byte-and-proxy-buffering/213137/2 "2011-10-25T00:54:25Z")

</div>

Hello!

On Mon, Oct 24, 2011 at 11:17:05PM +0100, Jonathan M. wrote:

> Does “proxy\_buffering on” (especially when it’ll definitely buffer to  
> disk) imply that the client will _not_ be sent the first part of the  
> response until nginx has received and buffered the entire response  
> from the upstream server?

No.

> Or does/can the upstream response buffering  
> happen in parallel with the client-side response being sent?

Yes.

There is a caveat though: individual buffers (see proxy\_buffers  
directive) will be sent to client only once they are fully filled.  
And that’s why “proxy\_buffering off” exists: it allows pass all  
data without any delay even if buffer isn’t yet filled, as this  
may be critical in some use cases (streaming, some server push  
cases).

Maxim D.

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [October 25, 2011, 12:35pm UTC](https://www.ruby-forum.com/t/time-to-first-byte-and-proxy-buffering/213137/3 "2011-10-25T12:35:38Z")

</div>

On 24 October 2011 23:53, Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> cases).  
> Many thanks for the clarification, Maxim.

I submit that this would a useful addition to the documentation,  
especially as the current (English) documentation’s wording /could/  
suggest the opposite, if only by inference:

[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HttpProxyModule#proxy_buffering:) “If buffering  
is switched off, then the response is synchronously transferred to  
client immediately” … perhaps implying that if switched /on/, the  
response is _not_ “transferred to client immediately”.

## Cheers, Jonathan

Jonathan M.  
London, UK

> **[Jonathan Matthews :: Words Typed, Great Rates For Cash](https://www.jpluscplusm.com)**
