Slow Lighttpd on redirect_to

This seems to be an issue that pops up every so often on the Ruby on Rails mailing list and IRC channel and probably elsewhere. When using Lighttpd proxypassed behind Apache (this might also be true if you’re not behind Apache, I’m too lazy to check) the redirect_to function will take roughly 30 seconds to complete.

To get around this, you can disable Keep Alive in Lighttpd by adding the following line to your config:

server.max-keep-alive-requests = 0

According to the Lighttpd Trac this has been fixed earlier today, so expect this to go away with the next Lighttpd release.

Update: Seems you can also get around this by hacking ActionController. Personally I prefer disabling KeepAlive.