I have a server that handle both http
and https
request.
The common routine between client and server is based on two request:
1) The user request a file with an url, eg.:
2) The server makes some check and redirect in the response headers to a new url:
location: https://example.com/files/10.zip
3) The browser, after redirect to the new url, request the file:
https://example.com/files/10.zip
4) The server, sends the file "10.zip" in the response stream:
ResponseInfo.ContentStream := TFileStream.Create('C:\10.zip', fmOpenRead or fmShareDenyNone);
all routine is of two request (1, 4), and for this reason i have disabled session and keepAlive:
IdHTTPServer.KeepAlive := False;
IdHTTPServer.AutoStartSession := False;
IdHTTPServer.SessionState := False;
I think keep alive has huge benefit only on multiple round trip, this seem a good idea into my scenario when user use http, but, maybe this isn't a good idea when the user use https, because each request without KeepAlive is a new request and the initial setup costs of a HTTPS connection are far higher.
Enabling KeepAlive on IdHTTPServer
has some performance benefit into my scenario?
Apache 2.4 has default KeepAliveTimeout at 5 seconds. For IndyServer is good a value in order of some seconds?