Conditional Page Caching [Solution: Conditional Fragment Caching]
问题 Suppose that I have controller home_controller.rb with action index . I want to cache index page so I'm doing: caches_page :index but want it to cache only for users that are not signed in. If I'll make conditional like: caches_page :index, :if => :user_not_signed_in? Page will be cached while first not logged in user comes. Now every logged in user also see not-logged in content. Is there a way to separate this action without changing url? 回答1: cache_if and cache_unless seems to be the