当片段在 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/