Move user_data async controller cache to Redis (#4809) [deploy]

This commit is contained in:
Molly Struve 2019-11-13 10:25:17 -06:00 committed by GitHub
parent b57ced5466
commit 880f60beff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,7 +30,7 @@ class AsyncInfoController < ApplicationController
end
def user_data
Rails.cache.fetch(user_cache_key, expires_in: 15.minutes) do
RedisRailsCache.fetch(user_cache_key, expires_in: 15.minutes) do
{
id: @user.id,
name: @user.name,
@ -60,7 +60,7 @@ class AsyncInfoController < ApplicationController
end
def user_cache_key
"#{current_user&.id}__
"user-info-#{current_user&.id}__
#{current_user&.last_sign_in_at}__
#{current_user&.last_followed_at}__
#{current_user&.updated_at}__