This is a follow up to my previous post about clearing out sessions. It turns out I was pulling a lot of crap sessions from rss feeds and xml requests which I didn’t need. I had over 14k new sessions in less than one day. To help combat this, I came up with a solution to turn sessions off based on a request type. I added this to application.rb file:
session :off, :if => Proc.new { |req| ['xml', 'rss'].include?(req.params[:format]) }
You could ideally just add this to an individual controller, and add
nly or :except to it as well, but I wanted to eliminate all of the controllers and actions.