Expire Frequently Updated Cache Keys Sooner (#4793) [deploy]
This commit is contained in:
parent
af04fd7959
commit
57250ade63
1 changed files with 6 additions and 6 deletions
|
|
@ -241,8 +241,8 @@ class User < ApplicationRecord
|
|||
|
||||
def cached_following_users_ids
|
||||
RedisRailsCache.fetch(
|
||||
"user-#{id}-#{updated_at}-#{following_users_count}/following_users_ids",
|
||||
expires_in: 120.hours,
|
||||
"user-#{id}-#{last_followed_at}-#{following_users_count}/following_users_ids",
|
||||
expires_in: 12.hours,
|
||||
) do
|
||||
Follow.where(follower_id: id, followable_type: "User").limit(150).pluck(:followable_id)
|
||||
end
|
||||
|
|
@ -250,8 +250,8 @@ class User < ApplicationRecord
|
|||
|
||||
def cached_following_organizations_ids
|
||||
RedisRailsCache.fetch(
|
||||
"user-#{id}-#{updated_at}-#{following_orgs_count}/following_organizations_ids",
|
||||
expires_in: 120.hours,
|
||||
"user-#{id}-#{last_followed_at}-#{following_orgs_count}/following_organizations_ids",
|
||||
expires_in: 12.hours,
|
||||
) do
|
||||
Follow.where(follower_id: id, followable_type: "Organization").limit(150).pluck(:followable_id)
|
||||
end
|
||||
|
|
@ -259,8 +259,8 @@ class User < ApplicationRecord
|
|||
|
||||
def cached_following_podcasts_ids
|
||||
RedisRailsCache.fetch(
|
||||
"user-#{id}-#{updated_at}-#{last_followed_at}/following_podcasts_ids",
|
||||
expires_in: 120.hours,
|
||||
"user-#{id}-#{last_followed_at}/following_podcasts_ids",
|
||||
expires_in: 12.hours,
|
||||
) do
|
||||
Follow.where(follower_id: id, followable_type: "Podcast").pluck(:followable_id)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue