我们有Rails 4.2应用程序在生产中运行,具有以下配置(与缓存相关)。我们迄今尚未实施任何缓存技术(默认设置)。 config.action_controller.perform_caching = true
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
我遇到
我正在处理的项目是控制台风格的应用程序,根本无法访问任何持久对象。我们所有的模型都是临时对象,可以扩展到Hashie::Mash,并通过访问各种API调用来动态填充。 我正在研究Rails fragment caching,这些示例暗示片段缓存机制依赖于持久性模型。 我正在寻找不假设持久模型的片段缓存的示例。
我正在玩片段缓存,我已阅读指南并观看了railscast。 我试图做一个基本show动作有些片段缓存: 控制器: class PostsController < ApplicationController
before_action :set_post, only: [:show]
def show
end
private
# Use call