diff --git a/app/controllers/async_info_controller.rb b/app/controllers/async_info_controller.rb index 02cd4bab6..21197e46f 100644 --- a/app/controllers/async_info_controller.rb +++ b/app/controllers/async_info_controller.rb @@ -74,6 +74,7 @@ class AsyncInfoController < ApplicationController def user_cache_key "user-info-#{current_user&.id}__ #{current_user&.last_sign_in_at}__ + #{current_user&.following_tags_count}__ #{current_user&.last_followed_at}__ #{current_user&.updated_at}__ #{current_user&.reactions_count}__ diff --git a/app/decorators/user_decorator.rb b/app/decorators/user_decorator.rb index 8c7728582..78feb646a 100644 --- a/app/decorators/user_decorator.rb +++ b/app/decorators/user_decorator.rb @@ -19,7 +19,8 @@ class UserDecorator < ApplicationDecorator ].freeze def cached_followed_tags - follows_map = Rails.cache.fetch("user-#{id}-#{last_followed_at&.rfc3339}/followed_tags", expires_in: 20.hours) do + follows_map = Rails.cache.fetch("user-#{id}-#{following_tags_count}-#{last_followed_at&.rfc3339}/followed_tags", + expires_in: 20.hours) do Follow.follower_tag(id).pluck(:followable_id, :points).to_h end