- <% @genres.each do |genre| %>
- -
- <%= link_to genre.name, genres_path(genre.slug), data: { "umami-event": "Home-Genre-Click" },
- class: "underline hover:text-cx-purple"
- %>
-
+ <% cache @genres, expires_in: 60.seconds do %>
+ <% @genres.each do |genre| %>
+ -
+ <%= link_to genre.name, genres_path(genre.slug), data: { "umami-event": "Home-Genre-Click" },
+ class: "underline hover:text-cx-purple"
+ %>
+
+ <% end %>
<% end %>
@@ -23,8 +25,10 @@
- <% @recent_products.each do |product| %>
- <%= render(Products::CardComponent.new(product: product, number_of_products: 4)) %>
+ <% cache @recent_products, expires_in: 60.seconds do %>
+ <% @recent_products.each do |product| %>
+ <%= render(Products::CardComponent.new(product: product, number_of_products: 4)) %>
+ <% end %>
<% end %>
@@ -44,8 +48,10 @@
- <% @stores.each do |store| %>
- <%= render(Stores::CardComponent.new(store: store)) %>
+ <% cache @stores, expires_in: 60.seconds do %>
+ <% @stores.each do |store| %>
+ <%= render(Stores::CardComponent.new(store: store)) %>
+ <% end %>
<% end %>
@@ -65,8 +71,10 @@
- <% @creator_profiles.each do |creator_profile| %>
- <%= render(CreatorProfiles::CardComponent.new(creator_profile: creator_profile)) %>
+ <% cache @creator_profiles, expires_in: 60.seconds do %>
+ <% @creator_profiles.each do |creator_profile| %>
+ <%= render(CreatorProfiles::CardComponent.new(creator_profile: creator_profile)) %>
+ <% end %>
<% end %>
@@ -86,8 +94,10 @@
- <% @onboarded_products.each do |product| %>
- <%= render(Products::CardComponent.new(product: product, number_of_products: 4)) %>
+ <% cache @onboarded_products, expires_in: 60.seconds do %>
+ <% @onboarded_products.each do |product| %>
+ <%= render(Products::CardComponent.new(product: product, number_of_products: 4)) %>
+ <% end %>
<% end %>
@@ -257,8 +267,10 @@
- <% @posts.each do |post| %>
- <%= render(Marketing::PostBlurbComponent.new(post: post)) %>
+ <% cache @posts, expires_in: 60.seconds do %>
+ <% @posts.each do |post| %>
+ <%= render(Marketing::PostBlurbComponent.new(post: post)) %>
+ <% end %>
<% end %>