Add this line to your application's Gemfile:
And then execute:
Create a YAML file at
config/response-headers.yml with a mapping from your controller actions
to the set of headers which should be set in the response. For example:
# config/response-headers.yml welcome#index: Surrogate-Control: public, max-age=120 Vary: Accept-Encoding, Accept-Language
index action of
WelcomeController is hit,
Vary headers will
be included in the response.
Bug reports and pull requests are welcome on GitHub at https://github.com/efforg/rails_response_headers.
The gem is available as open source under the terms of the MIT License.