Add following_tags_count to release_adjusted_cache_key (#11055) [deploy]

* Adds following_tags_count to release_adjusted_cache_key

* Adds following_tags_count to release_adjusted_cache_key in index.html.erb
This commit is contained in:
Julianna Tetreault 2020-10-26 07:46:08 -06:00 committed by GitHub
parent 3787f46863
commit 894de8c73f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -1,7 +1,7 @@
<div id="sidebar-wrapper-left" class="sidebar-wrapper sidebar-wrapper-left crayons-layout__sidebar-left">
<div class="sidebar-bg" id="sidebar-bg-left"></div>
<aside class="side-bar" aria-label="Primary sidebar">
<% cache(release_adjusted_cache_key("main-sidebar-nav--#{user_signed_in?}"), expires_in: 15.minutes) do %>
<% cache(release_adjusted_cache_key("main-sidebar-nav--#{user_signed_in?}--#{current_user&.following_tags_count&.positive?}"), expires_in: 15.minutes) do %>
<%= render "articles/sidebar_nav" %>
<% @sponsorships = Sponsorship.gold.live.includes(:organization).order(featured_number: :asc) %>
<%# the pattern .present?/.each has the advantage of issuing only a single SQL query to load objects in memory %>

View file

@ -26,7 +26,7 @@
<%= javascript_packs_with_chunks_tag "homePage", defer: true %>
<% cache(release_adjusted_cache_key("main-stories-index-#{params}-#{user_signed_in?}"), expires_in: 90.seconds) do %>
<% cache(release_adjusted_cache_key("main-stories-index-#{params}-#{user_signed_in?}-#{current_user&.following_tags_count&.positive?}"), expires_in: 90.seconds) do %>
<div class="crayons-layout crayons-layout--3-cols crayons-layout--3-cols--drop-right-left" id="index-container"
data-params="<%= params.merge(sort_by: "hotness_score", sort_direction: "desc").to_json(only: %i[tag username q sort_by sort_direction]) %>" data-which="<%= @list_of %>"
data-tag=""