cache_digests icon indicating copy to clipboard operation
cache_digests copied to clipboard

problem when using fragment caching without digests

Open Lorjuo opened this issue 11 years ago • 0 comments

Hi, I have the following situation: My navigation is organized tree-based structure that is rendered recursively by partials. Because of that complex recursive structure I stopped trying to achieve this with cache_digests. So I tried to implement a global fragment cache for the whole navigation at once that doesn't use digests:

<% cache('navigation', :skip_digest => false) do %>
  <%= render :partial => "layouts/navigation_element", collection: NavigationElement.roots, :as => :navigation_element %>
<% end %>

That worked as excepted and the navigation gets cached. But I also get some errors in the log that refers to cache_digest: [ERROR] Couldn't find template for digesting: navigation_elements/navigation_element.html

I think the render directive still tries to generate a digest for navigation_element although it isn't used.

So I tried to use the skip_digest option, that doesn't seem to have any effect in here.

This error message has also been referenced in this issue: https://github.com/rails/cache_digests/issues/31 and the recommendation was to just ignore it. But I do not really feel right with this.

Is there any possibility to just turn off cache_digests for this part of my homepage?

Thanks

Lorjuo avatar Mar 29 '14 10:03 Lorjuo