fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.35k stars 343 forks source link

Update: Ensure that progress reports are sent ASAP #1430

Closed jtojnar closed 1 year ago

jtojnar commented 1 year ago

Follow-up to 9741e39d1fa4070d4d42e774c8c088da055eaa7b.

Various layers in the network stack including php-fpm, Apache’s mod_proxy_fcgi and Nginx’s ngx_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 for zlib.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.

netlify[bot] commented 1 year ago

Deploy Preview for selfoss canceled.

Name Link
Latest commit 9a3d7cf2d124350c235d36c149692d24918d5495
Latest deploy log https://app.netlify.com/sites/selfoss/deploys/64378814f0187600080cafcc