Reputation: 1067
I have some actions that respond with static content. I also need them cached on client.
Similar question was asked in the past for rails 2
Is it possible to omit set-cookie header from the response in Rails 2.3?
Upvotes: 5
Views: 4115
Reputation: 4786
Use the built in option.
env['rack.session.options'][:skip] = true
or
request.session_options[:skip] = true
or in older versions use this
env['rack.session.options'][:defer] = true
or
request.session_options[:defer] = true
You can find the documentation for it here http://rack.rubyforge.org/doc/Rack/Session/Abstract/ID.html
Upvotes: 11
Reputation: 22672
Try this: Remove charset from Rails content type or http://guides.rubyonrails.org/action_controller_overview.html#setting-custom-headers
Hope this would help.
Upvotes: 0