ActionController caching not working in dev and test environments

97 Views Asked by At

I have this controller:

class PagesController < ApplicationController
  caches_page :index

  def index
  end
end

and action_controller.perform_caching enabled for each in environment.

On production everything acts as expected, with the cached page being stored in public/cache/index.html but for dev and test the cached version of index.html is being regenerated on every request.

I'm using Rails 3.1.8

1

There are 1 best solutions below

0
On

Try changing your config.cache_classes setting, I can't guarantee this will help, in dev mode rails will generally reload everything.

http://guides.rubyonrails.org/configuring.html