ruby-on-rails - 多小对于片段缓存来说太小了?

标签 ruby-on-rails ruby-on-rails-3 caching memcached ruby-on-rails-3.2

当片段在 Rails 中缓存非动态 html 时

<% cache [:long_list] do %>
  <li><!-- Loads of html --></li>
  <li><!-- Loads of html --></li>
  <li><!-- Loads of html --></li>
  <!-- Loads more li items... -->
<% end %>

就缓存内容的大小而言,缓存是否会导致页面渲染速度下降?

更简单地说,这可能会降低性能吗?

<% cache :div do %>
  <div id="empty-content"></div>
<% end %>

假设用户使用内存缓存,例如 memcached。

最佳答案

我认为缓存静态内容没有意义,因为这些模板在生产中是预编译和缓存的 - 事实上,它们在内存中。

关于ruby-on-rails - 多小对于片段缓存来说太小了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13842317/

相关文章:

caching - Redis:可以使数组或排序集中的元素过期吗?

caching - Symfony 2 缓存清除问题

jquery - Rails jquery ui 日期选择器

ruby-on-rails - has_many 与多态关联中的 class_name

ruby-on-rails - 在Ruby/Rails中的.each循环的第一次迭代中检查的DRYest方法

ruby-on-rails-3 - 范围内的实例方法

ruby-on-rails - 基于 View /喜欢/不喜欢的趋势产品

mysql - 开发中连接 Sphinx MySQL 时遇到问题

ruby-on-rails - Rails 3 中标记系统的好方法?

python - 如何使用 Python 在 Redis 缓存中设置由同一列名下的多行组成的值