madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22757: LJSUP-13445: Home page optimization: sta...

Committer: sbelyaev
LJSUP-13445: Home page optimization: stage 2
U   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");

Tags: livejournal, madeon, pm, sbelyaev
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments