-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReverseProxy on Heroku with RackCache? #24
Comments
Hrmm, I don't see anything in there that signifies that this is a problem with rack-reverse-proxy. It looks like Rack::Cache is choking on a cache-control header, but I'm not sure where to point you for that. |
OK, that might be true, but I also have a problem when I try in development, here's my output: https://gist.github.com/3790532 Here's my config/development.rb: |
Turns out that all of the header values sent through reverse_proxy are wrapped in an array rather than a plain string. This breaks Rack::Cache further up the line.
Rack::Cache is expecting the Cache-Control header to be "cache-control" => "max-age=600, must-revalidate" instead. |
So maybe I should submit a patch to Rack::Cache? or submit a patch to send a string arg from ReverseProxy? |
I submitted a pull request with my patch that fixes the issue for me. #25 AFAIK, the Rack interface expects headers to be strings. Returning them as an array is not expected. |
Here's my config in config/production.rb:
https://gist.github.com/3786109
Heroku logs output:
https://gist.github.com/3786102
Went off this blog post:
http://bindle.me/blog/index.php/304/rack-middleware-for-seo-fun-and-profit
I realize I didn't use the RegEx, but I got a similar result when I did.
thank you!
The text was updated successfully, but these errors were encountered: