develooper Front page | perl.libwww | Postings from April 2003

Connection: close -- and LWP::RobotUA

Thread Next
Bill Moseley
April 12, 2003 23:01
Connection: close -- and LWP::RobotUA
Message ID:

I use LWP::RobotUA and use a delay.  But I'm thinking about setting the
delay to zero for the *next* request when using keep-alives and not seeing
the Connection: close response header.  Why delay if the server is waiting
for your next request?

So, two questions:

First, I'm not clear after trying to read the RFCs if I can depend on a
Connection: close header from an older server (< HTTP/1.1).  Can I assume
that the lack of that response header indicates the connection is not
closed?  Or is there a better way to determine if the connection was
closed after a request?

Second, do you agree that it make sense to not delay if the connection is
not closed? If the point of the delay is to reduce load on the server
then delaying when using keep-alives possibly could be making things worse
since the delay might force the connection to time out -- or just sit
there waiting.

And if it does make sense, should LWP::RobotUA track the last response and
not wait if the connection is already open?


Bill Moseley

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About