views: don't cache news updates.

Don't fragment cache the site news banner. Caching this trades a SQL
query for a Redis call, which is unlikely to make much performance
difference to page rendering but puts high traffic volume on Redis.
This commit is contained in:
evazion
2020-12-01 19:11:05 -06:00
parent 0be0395776
commit facc73f23f

View File

@@ -1,5 +1,4 @@
<% cache("news-updates", :expires_in => 1.hour) do %> <% if NewsUpdate.recent.present? %>
<% if NewsUpdate.recent.any? %>
<div id="news-updates" data-id="<%= NewsUpdate.recent.first.try(:id) %>" style="display: none;"> <div id="news-updates" data-id="<%= NewsUpdate.recent.first.try(:id) %>" style="display: none;">
<ul> <ul>
<% NewsUpdate.recent.each do |news_update| %> <% NewsUpdate.recent.each do |news_update| %>
@@ -9,5 +8,4 @@
<a href="#" id="close-news-ticker-link">close</a> <a href="#" id="close-news-ticker-link">close</a>
</div> </div>
<% end %>
<% end %> <% end %>