|No such thing as a small change|
NPH and Connection: Keep-Aliveby gfairweather (Novice)
|on Mar 24, 2009 at 13:48 UTC||Need Help??|
gfairweather has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I had a problem whereby when sending a '304 Not Changed' Perl/Apache would send a Content-Type, which the HTTP/1.1 protocol states should not be sent with this status. rfc2616 Section 10.3.5
I was directed towards using NPH CGI NPH and so prepended 'nph-' to my script name and added all the appropriate headers that were prevously filled in by Apache.
Now with this code the Content-Type is no longer sent, which is what is specified in the rfc
So I used the print method and not the CGI method for sending HTTP headers.
Now my issue is that Connection: Keep-Alive no longer functions, I can create and send the headers to the client but when my script exits the connection is closed. I tested this using telnet and performing GET requests. rfc2616 Section 14.10 Apache Keep-Alive
So my questions are, can I interact with Apache in some way so that I can use Connection: Keep-Alive when running a NPH script or is there some other solution that I have missed along the way that fixes both the 304 and Keep-Alive issue? (I am using Perl 5.6.1 and Apache 1.3.26 on a hosted server over which I have little control.)
Any help or pointers are greatly appreciated