DOCS LLMs

Caching

RailsFast comes with everything ready and configured so you can just cache database-intensive parts of your with just the keyword cache:

<% @products.each do |product| %>
  <% cache product do %>
    <%= render product %>
  <% end %>
<% end %>

Or, if you want to cache conditionally, you can do so with cache_if:

<% cache_if admin?, product do %>
  <%= render product %>
<% end %>

Learn everything you can do with caching in the official Rails caching docs