title: Does Rails.cache.fetch perform better with memoization
body: <p>I've searched and cannot seem to find a good source for whether it could be considered a good practice to combine methods for the following: When using memcached with the dalai gem and have a method that is called more than once for a request is there a performance advantage to using the second block over the first in a model? Is it considered good practice to use 'memoization' like this in conjunction with Rails.cache.fetch?</p>
  
  <pre><code>def total_ham
    Rails.cache.fetch("#{self.cache_key}/total_ham") do
      self.hams.sum(:metric_tons)
    end
  end
  </code></pre>
  
  <p>or</p>
  
  <pre><code>def total_ham
    @total_ham ||= Rails.cache.fetch("#{self.cache_key}/total_ham") do
      self.hams.sum(:metric_tons)
    end
  end
  </code></pre>