Update: Ensure that progress reports are sent ASAP #1430
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up to 9741e39.
Various layers in the network stack including php-fpm, Apache’s
mod_proxy_fcgi
and Nginx’sngx_http_fastcgi_module
will buffer responses.Since the individual events are short compared to buffer sizes, it may happen that PHP keeps holding onto the output, waiting for the response buffer to fill up, and, in the meanwhile, nginx will time out waiting for the contents.
Let’s prevent that by ending all output buffering we can on PHP side.
(There would be ¿up to two? levels: one for
output_buffering
, one forzlib.output_compression
.)Web server buffering is not that critical (unless there is another layer like a proxy) but it is useful to disable it as well so that progress updates are reflected live. We will do that for nginx, where it can be done simply with a response header (unless disabled in nginx configuration).
Since the response will now start arriving immediately, we need to modify the client so that the promise returned by
refreshAll
is only fulfilled once the whole body arrives. Otherwise, the refresh icon would stop spinning just after receiving the headers.