From da2fa608c271d15d9ce49a9fc36db555a8f7ebeb Mon Sep 17 00:00:00 2001 From: jeffin sam Date: Sat, 16 Nov 2019 00:33:41 +0530 Subject: [PATCH] Move social_image cache to Redis (#4818) --- app/view_objects/articles/social_image.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/view_objects/articles/social_image.rb b/app/view_objects/articles/social_image.rb index 6ea3a5710..57e8584ca 100644 --- a/app/view_objects/articles/social_image.rb +++ b/app/view_objects/articles/social_image.rb @@ -32,9 +32,9 @@ module Articles attr_reader :article def legacy_article_social_image - cache_key = "article-social-img-#{article}-#{article.updated_at}-#{article.comments_count}" + cache_key = "article-social-img-#{article}-#{article.updated_at.rfc3339}-#{article.comments_count}" - Rails.cache.fetch(cache_key, expires_in: 1.hour) do + RedisRailsCache.fetch(cache_key, expires_in: 1.hour) do src = GeneratedImage.new(article).social_image return src if src.start_with? "https://res.cloudinary.com/"