in reply to NPH and Connection: Keep-Alive
Update: -type => '' to prevent Content-Type.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: NPH and Connection: Keep-Alive
by gfairweather (Novice) on Mar 24, 2009 at 15:06 UTC | |
Thank you, this resolves the problem with the Content-Type being sent when the script is NPH and using the CGI method. However, it does not appear to resolve the Connection: Keep-Alive issue, the connection is still being closed when the script finishes. My script is calculating the body length and sending the Content-Length header, aswell as any other headers that are specified in the rfc. 304 Example using: Here is the connection closing after issueing the 304:
And here after serving a page:
And here 2 requests not using a script:
Any further information appreciated | [reply] [d/l] [select] |
by ikegami (Patriarch) on Mar 24, 2009 at 16:39 UTC | |
| [reply] |
by gfairweather (Novice) on Mar 25, 2009 at 11:32 UTC | |
Here are 2 snippets that you can try to see the effect.
hello.pl
You will see that hello.pl sends keep-alives as expected as the headers are parsed by Apache and the connection remains open nph-hello.pl
You will see that nph-hello.pl does not send keep-alives as the headers are not parsed by Apache and the connection closes upon exit I have tried adding the 'Connection' and 'Keep-Alive' headers to nph-hello.pl and of course they are sent but Apache does not keep the connection open. Example:
This is what I am trying to accomplish. | [reply] [d/l] [select] |
by gfairweather (Novice) on Apr 01, 2009 at 02:26 UTC | |
The issue with the Content-Type being sent with the 304 response has been resolved. It appears that the issue was with the configuration of the host providers Apache setup. They moved the website onto a different server and the problem went away. I have not had confirmation but I think it was because they had a DefaultType set in the httpd.conf but also the new server is running a newer version of Apache so I can't be sure but it also may have been a bug in Apache 1.3. So I have moved away from using NPH and no longer have to worry about the Keep-Alive issue as that functions correctly in non NPH mode. Many thanks for your help. | [reply] |