Doable ? action caching if anonymous, fragment caching if lo


#1

Hi All,

I’d like to use different caching strategies based on the visitor status

  • anonymous => action caching
  • logged in => fragment caching

Is that doable? Where should I start?

TIA

Alain


#2

SOLVED

The action_cache plugin
http://agilewebdevelopment.com/plugins/action_cache

adds a methods that enables conditional action caching :

class ApplicationController < ActionController::Base

   def cache_action?(action_name)
     !admin?
   end
 ...
end