Topic: Action Caching caches entire layout even with :layout => false

I am implementing action caching. I am specifying :layout => false to only cache the action content, however the entire template is being cached for these actions. Does anybody have any ideas why this could be happening?

Here is my controller code:

caches_action :index, :cache_path => :index_cache_path.to_proc, :layout => false


def index_cache_path
  if logged_in?

Removing the :cache_path directive doesn't make a difference either.


I was running Rails 2.1.1. I upgraded to Rails 2.2.2 and now I have the :layout => false functionality. Funny how I always figure out these simple errors after I've already posted my problem...

Last edited by swese44 (2009-01-31 01:25:20)

Re: Action Caching caches entire layout even with :layout => false

Well, I have now moved the website into production. Caching was working perfectly on my development server, but now that I am on the production server the action caching has reverted to caching the entire page instead of just the action content, even though I have :layout => false set for all cached actions.

Does anybody know why this could be happening? I have Rails 2.2.2 installed on my production server and '2.2.2' set for RAILS_GEM_VERSION in environment.rb.

I am completely stumped, and I cannot officially launch the site until I can get this resolved. Any help would be much appreciated.

Re: Action Caching caches entire layout even with :layout => false

Once again, just a Rails version issue. My hosting company says that they only have Rails 2.0 available and I'll have to wait for them to install Rails 2.2.2. Everything should work fine again once Rails 2.2.2 is installed.