From c648997b1cadc09840ee42b450dc4859259695fe Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 11 Nov 2011 00:55:02 +0400 Subject: more aggressive prefs caching --- db-prefs.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'db-prefs.php') diff --git a/db-prefs.php b/db-prefs.php index cf941cebe..7a522d6ad 100644 --- a/db-prefs.php +++ b/db-prefs.php @@ -18,7 +18,7 @@ @$profile = $_SESSION["profile"]; } else { $user_id = sprintf("%d", $user_id); - $prefs_cache = false; + //$prefs_cache = false; } if ($prefs_cache && !defined('DISABLE_SESSIONS') && !SINGLE_USER_MODE) { @@ -130,7 +130,12 @@ $profile_qpart AND owner_uid = " . $_SESSION["uid"]); - $_SESSION["prefs_cache"] = array(); + if (!defined('DISABLE_SESSIONS') && !SINGLE_USER_MODE) { + if ($user_id = $_SESSION["uid"]) { + $_SESSION["prefs_cache"][$pref_name]["type"] = $type_name; + $_SESSION["prefs_cache"][$pref_name]["value"] = $value; + } + } } } -- cgit v1.2.3