Server stream-response-bodyDetails » History » Revision 3
Revision 2 (horgh, 2017-03-11 20:38) → Revision 3/7 (gstrauss, 2017-03-13 16:57)
h1. Server stream-response-bodyDetails config options to stream response allows admin to configure if response is collected in entirety prior to sending data to client table{margin-left: 2em}. |_.option |_. description | | server.stream-response-body = 0 | default: buffer entire response body before sending to client | | server.stream-response-body = 1 | stream response body to client; buffer to temp files | | server.stream-response-body = 2 | stream response body to client; minimal buffering might block backend | The difference between @server-response-body = 1@ and @server-response-body server-@response-body = 2@: lighttpd is typically faster than the client and typically faster than the backend. Users who stream a large response will most likely want @server-response-body = 1@ so that lighttpd buffers (to tempfiles) the response from the backend as quickly as the backend produces it, even if lighttpd was unable to send the response as quickly to a (far away) client. Buffering the response from the backend allows the backend to finish sending its response quickly, and then to go on serving other requests. This is quite advantageous when the backend is a fat PHP script client compared to the slim lighttpd. @server-response-body = 2@ is more appropriate when the backend is producing what might be an extremely large stream and it is desired that the backend be *blocked* from sending more response data when lighttpd is unable to send response data just as quickly to the client. While this avoids the tempfiles, it also blocks the backend producer from sending more data, which might be desirable for some use cases, though probably not for the most common use cases. This might be appropriate for large generated responses from a backend to lighttpd on a small embedded system which does not have a large amount of disk space for temporary files. @server-response-body = 0@ just means that lighttpd should buffer the entire response from the backend before starting to send the response to the client. This currently allows mod_deflate (if configured) to compress the response before sending it to the client. In most cases, the response from the backend is small enough, the backend is located on the same machine as the lighttpd server, and the backend produces the response quickly enough that there is not a big perceived difference between @server-response-body = 0@ and @server-response-body = 1@. However, the tunable exists for those who do have use cases which suggest a different tuning from the default.