add caching for sitemap.xml

This commit is contained in:
Albert Yi
2018-10-11 10:15:45 -07:00
parent 6ca9b65716
commit f8e9170824

View File

@@ -15,7 +15,7 @@
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<%# cache("sitemap", :expires_in => 24.hours) do %> <% cache("sitemap", :expires_in => 24.hours) do %>
<% @popular_search_service.each_search do |tags, count| %> <% @popular_search_service.each_search do |tags, count| %>
<url> <url>
<loc><%= posts_url(tags: tags) %></loc> <loc><%= posts_url(tags: tags) %></loc>
@@ -37,5 +37,5 @@
<lastmod><%= post.created_at.to_date %></lastmod> <lastmod><%= post.created_at.to_date %></lastmod>
</url> </url>
<% end %> <% end %>
<%# end %> <% end %>
</urlset> </urlset>