Tag: 页面缓存

如何在rails中的function测试中启用页面缓存?

是否可以打开页面缓存进行function测试? 以下不起作用: class ArticlesControllerTest < ActionController::TestCase def setup ActionController::Base.public_class_method :page_cache_path ActionController::Base.perform_caching = true end end 提前致谢 德布

使用Rails 3.2缓存未命中和开发中的页面缓存 – 还有其他人吗?

在开发模式下使用Rails 3.2,我试图测试一些简单的页面缓存。 pages_controller.rb class PagesController < ActionController::Base caches_page :index, :show def index @pages = Page.all end def show @page = Page.find(params[:id]) end end development.rb config.action_controller.perform_caching = true application.rb中 config.action_controller.page_cache_directory = File.join(Rails.root, ‘public’) 当我测试这个设置时,似乎正常处理这些操作,并且页面缓存按预期编写。 但是,后续请求报告了以下两件令我困惑的事情: 它似乎错过了缓存,但…… 之后的请求似乎没有加载控制器,运行任何查询等,导致我相信它从缓存加载DID。 这是第一次请求时日志输出的内容,然后是五次重新加载: Started GET “/pages” for 127.0.0.1 at 2012-02-12 21:01:24 -1000 Processing by PagesController#index as HTML Page Load (0.2ms) SELECT […]