问题
How to do page caching in rails 3. Is there is any plugins or gem for that? whether page_cache_fu will work for rails 3?
回答1:
You can do it directly in the controller. Below is directly from the Rails Guide
class ProductsController < ActionController
caches_page :index
def index
@products = Products.all
end
end
回答2:
watch this video: http://railslab.newrelic.com/2009/01/22/page-caching - it was created before the rails 3 days, but I'd imagine it's still quite relevent
hope it helps
来源:https://stackoverflow.com/questions/3861635/page-caching-for-rails-3