Skip to content

Commit

Permalink
FIX: don't calculate digests
Browse files Browse the repository at this point in the history
we are handling cache key expiry ourselves so assume we know what we are doing and don't care about digests

provides substantial speedup
  • Loading branch information
ghiculescu committed Jun 20, 2016
1 parent 6e8a451 commit 59612d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/multi_fetch_fragments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ def render_collection_with_multi_fetch_cache

@collection.each do |item|
key = @options[:cache].respond_to?(:call) ? @options[:cache].call(item) : item
skip_digest = @options[:cache].respond_to?(:call) # assume we are handling cache key expiry ourselves

key_with_optional_digest = nil
if defined?(@view.fragment_name_with_digest)
key_with_optional_digest = @view.fragment_name_with_digest(key, @view.view_cache_dependencies)
elsif defined?(@view.cache_fragment_name)
key_with_optional_digest = @view.cache_fragment_name(key)
key_with_optional_digest = @view.cache_fragment_name(key, skip_digest: skip_digest)
else
key_with_optional_digest = key
end
Expand Down

0 comments on commit 59612d5

Please sign in to comment.