I have an app and I'd like to cache some parts of the page, and I have been reading a lot about the ways to do this.
I understand that fragment caching is the best way to do it on my project, but I can´t find a simple example to learn how to implement this.
I would like to use the fragment cache with 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 %>
Where do I set the autoexpire? any examples around? how can I do this?
In your product model you can do something like this