Fragment caching

Posted by red5 on Stack Overflow See other posts from Stack Overflow or by red5
Published on 2010-05-01T20:47:26Z Indexed on 2010/05/01 20:47 UTC
Read the original article Hit count: 343

Filed under:

I would like to fragment cache part of a page.
On the view I have

<% cache("saved_area") do %>
.
 <% end -%>

In the controller:

  def index 

   read_fragment("saved_area")

   end

In config/production:

   config.cache_store = :file_store, File.join(RAILS_ROOT, 'tmp', 'cache') 

The file was created in the tmp/cache directory. But I am not sure if the cache is being used in the request, since I presume there should be a line in the log stating that the cache is being used (and there is not).

© Stack Overflow or respective owner

Related posts about ruby-on-rails