Committer: sbelyaev
LJSUP-13445: Home page optimization: stage 2U trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/User.pm =================================================================== --- trunk/cgi-bin/LJ/User.pm 2012-08-28 12:48:02 UTC (rev 22756) +++ trunk/cgi-bin/LJ/User.pm 2012-08-28 13:07:01 UTC (rev 22757) @@ -7202,7 +7202,13 @@ # check memcache { - my $uid = LJ::MemCache::get("uidof:$user"); + my $uid; + if ($LJ::PRELOADED_USER_IDS{$user} && !$LJ::IS_DEV_SERVER) { + $uid = $LJ::PRELOADED_USER_IDS{$user}; + } else { + $uid = LJ::MemCache::get("uidof:$user"); + } + $u = LJ::memcache_get_u([$uid, "userid:$uid"]) if $uid; return _set_u_req_cache($u) if $u; } @@ -10379,6 +10385,7 @@ $user = LJ::canonical_username($user); + if ($LJ::PRELOADED_USER_IDS{$user} && !$LJ::IS_DEV_SERVER) { return $LJ::PRELOADED_USER_IDS{user}; } if ($LJ::CACHE_USERID{$user}) { return $LJ::CACHE_USERID{$user}; } my $userid = LJ::MemCache::get("uidof:$user");