浏览 3037 次
锁定老帖子 主题:Rails Caching Stores
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2012-06-28
粘贴至Rails API Caching stores All the caching stores from ActiveSupport::Cache are available to be used as backends for Action Controller caching. This setting only affects action and fragment caching as page caching is always written to disk. Configuration examples (MemoryStore is the default): config.action_controller.cache_store = :memory_store config.action_controller.cache_store = :file_store, "/path/to/cache/directory" config.action_controller.cache_store = :mem_cache_store, "localhost" config.action_controller.cache_store = :mem_cache_store, Memcached::Rails.new("localhost:11211") config.action_controller.cache_store = MyOwnStore.new("parameter")
请注意:设置 config.action_controller.cache_store = :mem_cache_store 只针对 action and fragment caching #action缓存和片段缓存 有效,页面缓存是会存入磁盘的!!! 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |