Board index » delphi » IdHttp/ssl/post/keep-alive

IdHttp/ssl/post/keep-alive


2004-08-10 02:04:22 AM
delphi205
Hello all,
I've scoured groups.google.com and read the relevant pages from "Indy
Indepth", but am still not sure.
I've developed a set of applications which communicate from a windows gui
client thru an isapi web module to a backend app server. The client
prepares a binary stream containing instructions for the server and uses
https://www.mydomain.com/scripts/myisapi.dll/ to post the request to the
server. My isapi dll then passes the request to the app server and the app
server will send a response back the same way.
I chose this configuration for several reasons:
1. I need to deploy it to a web farm with multiple web servers and a single
app server.
2. https will pass thru most firewalls.
3. ssl provides reasonable security and I believe we can export our client
app outside the usa.
I've begun looking for ways to fine tune to get maximum performance.
One thing I read about but am not complete clear on is "Keep-Alive". Is
this a way to connect to the web server and perform multiple posts? If so,
is it as simple as IdHttp.Request.Connection := 'Connection: Keep-Alive'?
Can I use http keep-alive in an rpc setup? My time testing indicates there
is signifigant overhead in establishing the ssl connection. If I could make
the connection, perform posts as the user operated the app and then
disconnect, then I might get a great deal of performance gain.
I'm using indy9 (latest build) and have read the source for the "Post"
method. It appears as if it disconnects before the actual post is done. So
are "Post" and "Keep-Alive" mutually exclusive?
Thanks
Mike
 
 

Re:IdHttp/ssl/post/keep-alive

"Mike Terry" <XXXX@XXXXX.COM>writes
Quote
One thing I read about but am not complete clear on
is "Keep-Alive". Is this a way to connect to the web
server and perform multiple posts?
It is a way for HTTP connections to not be dropped between requests to the
same server.
Quote
If so, is it as simple as IdHttp.Request.Connection := 'Connection:
Keep-Alive'?
IdHttp.Request.Connection := 'keep-alive';
Even then, there is no guarantee that the connection will actually be kept
alive, as the HTTP server has to agree to support the keep-alive request.
The HTTP client disconnects or maintains the connection based on the
server's response to the request.
Quote
Can I use http keep-alive in an rpc setup? My time testing
indicates there is signifigant overhead in establishing the ssl
connection. If I could make the connection, perform posts
as the user operated the app and then disconnect, then I
might get a great deal of performance gain.
Do you have to use HTTP? SSL is not specific to HTTP only, it can be used
with any TCP connection. You might be better off getting rid of the HTTP
and just establishing an SSL connection to the backend server directly, if
possible. Then you can do anything you want with the connection.
Gambit
 

Re:IdHttp/ssl/post/keep-alive

Thanks for your reply.
Quote
Do you have to use HTTP? SSL is not specific to HTTP only, it can be used
with any TCP connection. You might be better off getting rid of the HTTP
and just establishing an SSL connection to the backend server directly, if
I do have to use http as we need the clients to operate thru firewalls we
won't have any control over. We will require the user have the ability to
make http/https connections to our web site, but that is it.
Having the app server behind a bank of web servers is by design. The system
is a hybread between web interface and windows gui. The web servers will
serve up static html, dynamic html, act as gates to the app server and
maintain documents uploaded and downloaded from the windows gui app.
We will be renting whole servers with iis, so we will control keep-alive on
the server side.
Does the TIdHttp component in indy9 support keep-alive used with "post"? If
so, could you please sketch out a code snippet?
Thanks
Mike