1. 21 2月, 2015 2 次提交
    • K
      Collections automatically cache and fetch partials. · 11644fd0
      Kasper Timm Hansen 提交于
      Collections can take advantage of `multi_read` if they render one template
      and their partials begin with a cache call.
      
      The cache call must correspond to either what the collections elements are
      rendered as, or match the inferred name of the partial.
      
      So with a notifications/_notification.html.erb template like:
      
      ```ruby
      <% cache notification %>
        <%# ... %>
      <% end %>
      ```
      
      A collection would be able to use `multi_read` if rendered like:
      
      ```ruby
      <%= render @notifications %>
      <%= render partial: 'notifications/notification', collection: @notifications, as: :notification %>
      ```
      11644fd0
    • K
      Merge multi_fetch_fragments. · e56c6354
      Kasper Timm Hansen 提交于
      Makes caching a collection of template partials faster using `read_multi`
      on the Rails cache store.
      
      Some caching implementations have optimized `read_multi` so we don't have
      to check in the cache store for every template.
      e56c6354
  2. 15 2月, 2015 3 次提交
  3. 14 2月, 2015 10 次提交
  4. 13 2月, 2015 25 次提交