Rails 3 的页面缓存 [英] Page Caching for rails 3

查看:43
本文介绍了Rails 3 的页面缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 rails 3 中进行页面缓存.是否有任何插件或 gem?page_cache_fu 是否适用于 rails 3?

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?

推荐答案

您可以直接在控制器中进行.下面直接来自 Rails 指南

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

这篇关于Rails 3 的页面缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆