From a7a656299d273a0b1a3ff4230a811f819dd15970 Mon Sep 17 00:00:00 2001 From: "Eric J. Korpela" Date: Thu, 22 Jul 2004 23:42:50 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=3943 --- html/inc/cache.inc | 17 ++++++++++++++++- html/inc/profile.inc | 12 ++++++++++++ html/project.sample/cache_parameters.inc | 11 +++++++++++ html/user/download.php | 2 +- html/user/sample_index.php | 2 +- html/user/show_user.php | 2 +- html/user/team_display.php | 2 +- html/user/top_hosts.php | 2 +- html/user/top_teams.php | 2 +- html/user/top_users.php | 2 +- 10 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 html/project.sample/cache_parameters.inc diff --git a/html/inc/cache.inc b/html/inc/cache.inc index 64dc263d50..01b470b0c0 100644 --- a/html/inc/cache.inc +++ b/html/inc/cache.inc @@ -1,11 +1,26 @@ id != $logged_in_user->id)) { + $caching = true; + $cache_args = "userid=$userid"; + start_cache(USER_PROFILE_TTL,$cache_args); + } + } + + $profile = get_profile($userid); if (!$profile) { @@ -451,6 +462,7 @@ function show_profile($userid, $verify_mode=false) { if (!$verify_mode) { page_tail(); } + if ($caching) end_cache($cache_args); } function show_profile_summary($user, $profile, $can_edit, $verify_mode) { diff --git a/html/project.sample/cache_parameters.inc b/html/project.sample/cache_parameters.inc new file mode 100644 index 0000000000..54dfa60aa1 --- /dev/null +++ b/html/project.sample/cache_parameters.inc @@ -0,0 +1,11 @@ + diff --git a/html/user/download.php b/html/user/download.php index 03f62fb3ea..4ecd6e3f71 100644 --- a/html/user/download.php +++ b/html/user/download.php @@ -3,7 +3,7 @@ require_once("../inc/cache.inc"); require_once("../inc/util.inc"); -start_cache(3600); +start_cache(DOWNLOAD_PAGE_TTL); require_once("../inc/db.inc"); require_once("../inc/download.inc"); diff --git a/html/user/sample_index.php b/html/user/sample_index.php index c882d9fe77..710b6f7a6e 100644 --- a/html/user/sample_index.php +++ b/html/user/sample_index.php @@ -44,7 +44,7 @@ function show_nav() { "; } -//start_cache(3600); +//start_cache(INDEX_PAGE_TTL); $stopped = project_is_stopped(); diff --git a/html/user/show_user.php b/html/user/show_user.php index 2ce272ce06..e97d2d81d9 100644 --- a/html/user/show_user.php +++ b/html/user/show_user.php @@ -8,7 +8,7 @@ if ($format) { $cache_args .= "&format=xml"; } - start_cache(600, $cache_args); + start_cache(USER_PAGE_TTL, $cache_args); require_once("../inc/db.inc"); require_once("../inc/user.inc"); diff --git a/html/user/team_display.php b/html/user/team_display.php index a58a1b7344..beeebcb584 100644 --- a/html/user/team_display.php +++ b/html/user/team_display.php @@ -15,7 +15,7 @@ if ($offset > 1000) { } $cache_args = "teamid=$teamid&sort_by=$sort_by&offset=$offset"; -start_cache(3600, $cache_args); +start_cache(TEAM_PAGE_TTL, $cache_args); require_once("../inc/db.inc"); require_once("../inc/util.inc"); diff --git a/html/user/top_hosts.php b/html/user/top_hosts.php index 1554f2f032..0e438818ac 100644 --- a/html/user/top_hosts.php +++ b/html/user/top_hosts.php @@ -13,7 +13,7 @@ if ($offset < 1000) { $cache_args = "sort_by=$sort_by&offset=$offset"; - start_cache(12*3600, $cache_args); + start_cache(TOP_PAGES_TTL, $cache_args); } else { page_head("Limit exceeded"); echo "Sorry - first 1000 only."; diff --git a/html/user/top_teams.php b/html/user/top_teams.php index d0282d82fa..d5380c4f4a 100644 --- a/html/user/top_teams.php +++ b/html/user/top_teams.php @@ -13,7 +13,7 @@ if ($offset < 1000) { $cache_args = "sort_by=$sort_by&offset=$offset"; - start_cache(12*3600, $cache_args); + start_cache(TOP_PAGES_TTL, $cache_args); } else { page_head("Limit exceeded"); echo "Sorry - first 1000 only."; diff --git a/html/user/top_users.php b/html/user/top_users.php index 789241818f..91351448ce 100644 --- a/html/user/top_users.php +++ b/html/user/top_users.php @@ -13,7 +13,7 @@ if ($offset < 1000) { $cache_args = "sort_by=$sort_by&offset=$offset"; - start_cache(12*3600, $cache_args); + start_cache(TOP_PAGES_TTL, $cache_args); } else { page_head("Limit exceeded"); echo "Sorry - first 1000 only.";