Hi.
I have RoR app. It needs to use keepalive in its responses. It sits on
apache. I've configured apache and its serving static files from apache
with keepalive working, but dynamic pages generated by the RoR app are
closing the connection (tested thoroughly, and the response headers also
confirm this).
Yes, provide some actual information about your environment, like
the exact versions of Ruby, Rails, Apache, what the heck "sits on
apache" means, etc.
I can't give out the link in question. Sorry. However I can explain what
is happening. The connection is being closed on dynamic pages.
Refreshing the same page results in a full https handshake (2 full round
trips). Also the response headers show connection: close. But only for
dynamic content.
Static content is sending connection: Keep-Alive in the response header
and sure enough, when the page is refreshed the connection time is 0ms.
I.e. the connection has successfully been left open.
Googleing suggests that the keepAlive setting in Apache is all I need to
change. Having change the httpd.conf I can see the changes (examinin the
response headers) in the static content, but not the ruby stuff.
The output from ruby is using render to output xml.
I've not tried others, and there may be push back if I suggest this as a
solution, for various reasons. So solving with apache is my current
goal. It may also be worth noting that it's https in production, and it
seems to keep connections alive for some clients but not others for
http, but closes for all on https.
I've not tried others, and there may be push back if I suggest this as a
solution, for various reasons.
I didn't suggest it as a solution; it's part of problem isolation.
And don't you have a development/test/staging environment which
replicates your production environment, where you can try things like
this? If not, creating one would be my very next act...
It may also be worth noting that it's https in production, and it
seems to keep connections alive for some clients but not others for
http, but closes for all on https.
Could be helpful -- with some detail.
What determines which requests go to https?
Which clients get the behavior you want, which don't, and how do the
request headers differ?