[livejournal] r22657: LJSUP-13301: Main page optimization
Committer: sbelyaev
LJSUP-13301: Main page optimizationU trunk/cgi-bin/LJ/Widget/FriendBirthdays.pm
Modified: trunk/cgi-bin/LJ/Widget/FriendBirthdays.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/FriendBirthdays.pm 2012-08-15 12:37:43 UTC (rev 22656)
+++ trunk/cgi-bin/LJ/Widget/FriendBirthdays.pm 2012-08-15 13:40:12 UTC (rev 22657)
@@ -27,6 +27,12 @@
return "" unless @bdays;
+ my $cache_key = "friend_birthdays:" . $u->userid;
+ my $cache_data = LJ::MemCache::get($cache_key);
+ if ($cache_data) {
+ return $cache_data;
+ }
+
my $ret;
$ret .= '<div class="right-mod"><div class="mod-tl"><div class="mod-tr"><div class="mod-br"><div class="mod-bl">';
@@ -71,8 +77,9 @@
$ret .= "</ul>" if $opts{friends_link} or $opts{paidtime_link};
$ret .= '</div></div></div></div></div></div>';
-
-
+
+ LJ::MemCache::set($cache_key, $ret, 60*60*12);
+
return $ret;
}
