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
This commit is contained in:
Ad Schellevis 2024-03-21 14:42:29 +01:00
parent ff1991cdee
commit f25e1214dc

View File

@ -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";
}