0
我有一個應用程序,我想緩存頁面的一些部分,我一直在閱讀很多關於如何做到這一點。軌道上的紅寶石3.1片段緩存
我明白,片段緩存是在我的項目上做到這一點的最好方法,但我找不到一個簡單的例子來學習如何實現它。
我想使用片段緩存autoexpire。
<% cache(:action => 'recent', :action_suffix => 'all_products') do %>
All available products:
<% Product.all.each do |p| %>
<%= link_to p.name, product_url(p) %>
<% end %>
<% end %>
我在哪裏設置autoexpire?周圍的任何例子?我怎樣才能做到這一點?