title: Rails: cache.fetch vs cache.read/write
body: <p>is there any performance difference between</p>
  
  <pre><code>Rails.cache.fetch("key") { Model.all }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>models = Rails.cache.read("key")
  if models.nil?
      models = Model.all
      Rails.cache.write("key", models)
  end
  </code></pre>
  
  <p>If I must guess, i would say the upper one is just a shorthand for the other one.</p>