Apr
14th
Wed
14th
When mixing CherryPy and HTTP/1.1, use HTTP/1.0 instead.
While developing an app on top of CherryPy, I would get an insidious error: the browser would show a blank page. Randomly. This would happen about 10% of the time, but go up to 40% or 50% over time. Needless to say this was difficult to diagnose.
Here’s how we fixed it: Because we were running CherryPy behind Apache we told Apache to send HTTP/1.0 messages to CherryPy instead of HTTP/1.1 request. Here is the snippet from our Apache configuration file:
<Proxy *> Order Deny,Allow Allow from all SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1 </Proxy>
(Relevant Apache documentation)
I was unable to find the bits of the internet that helped aid the discovery of this bug, but it was a lot of Google searches. I did manage to find a link to a similar ticket: http://www.cherrypy.org/ticket/847, and it seems to be fixed now.