From f25e1214dc138a2e54d57a65c5ee435bac2e2df8 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 21 Mar 2024 14:42:29 +0100 Subject: [PATCH] webui - In order to allow streaming to the client, we like to prevent Lighttpd buffering our responses. This commit is a proposal to only enable streaming responses on api endpoints, as we do need to wait for the script to exit anyway. In theory we could do the same for /ui, but that's less important at the moment. Documented in https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_stream-response-bodyDetails --- src/etc/inc/plugins.inc.d/webgui.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/etc/inc/plugins.inc.d/webgui.inc b/src/etc/inc/plugins.inc.d/webgui.inc index 72a78d421..3c8a93aa5 100644 --- a/src/etc/inc/plugins.inc.d/webgui.inc +++ b/src/etc/inc/plugins.inc.d/webgui.inc @@ -433,8 +433,9 @@ EOD; $listener = "[{$listener}]"; } $lighty_config .= "\$SERVER[\"socket\"] == \"{$listener}:{$lighty_port}\" {\n"; + $lighty_config .= "\t\$HTTP[\"url\"] =~ \"^api\" {\n\t\tserver.stream-response-body = 2\n\t}\n"; if ($config['system']['webgui']['protocol'] == "https") { - $lighty_config .= ' ssl.engine = "enable"' . PHP_EOL; + $lighty_config .= "\tssl.engine = \"enable\"" . PHP_EOL; } $lighty_config .= "}\n"; }