【发布时间】:2014-06-23 23:23:44
【问题描述】:
为了提高我的 Rails 4.0.2 应用程序的性能,我想缓存一些静态页面的输出:
class PagesController < ApplicationController
def home
end
def about_us
end
def contact
end
end
在Rails Guide on Caching 中,它说“页面缓存已从 Rails 4 中删除”并移至 gem 中。但是,在gem description 中,它说它将只维护到 Rails 4.1。一些other observers 还建议不要使用页面缓存并支持Russian doll caching。
那么,缓存一堆静态页面的最佳方法是什么?这些页面永远不会真正访问数据库,并且只有在用户登录时才会(轻微地)改变?
感谢您的任何建议。
【问题讨论】:
-
Tintin81,我现在面临同样的问题。你的解决方案是什么?我猜是某种 HTTP 缓存,但是如何以及何时使页面过期?
标签: ruby-on-rails caching ruby-on-rails-4