Page Caching for rails 3

情到浓时终转凉″ 提交于 2019-12-11 06:32:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!