summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-03-16 21:49:33 +0000
committerDries Buytaert <dries@buytaert.net>2003-03-16 21:49:33 +0000
commit2c0f3c9457b1de508b52b46c2a7bfadd364d0f03 (patch)
tree76fd48b448811c1e5624b9b863831a7f3b16a8c3
parent297bc73f81441b13a2b1cdd49f471f9b20aa5271 (diff)
downloadbrdo-2c0f3c9457b1de508b52b46c2a7bfadd364d0f03.tar.gz
brdo-2c0f3c9457b1de508b52b46c2a7bfadd364d0f03.tar.bz2
- Cache improvement: only flush cache when told to.
-rw-r--r--includes/common.inc16
-rw-r--r--modules/system.module4
-rw-r--r--modules/system/system.module4
3 files changed, 5 insertions, 19 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 92672926f..57b79055d 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -643,15 +643,6 @@ function cache_clear_all($cid = NULL) {
}
}
-function cache_clear_old($cid = NULL) {
- if (empty($cid)) {
- db_query("DELETE FROM cache WHERE expire < ". time() ." AND expire > 0");
- }
- else {
- db_query("DELETE FROM cache WHERE cid = '%s' AND expire < %s AND expire > 0", $cid, time());
- }
-}
-
function page_set_cache() {
global $user, $REQUEST_METHOD;
@@ -666,10 +657,9 @@ function page_get_cache() {
global $user, $REQUEST_METHOD;
if (!$user->uid && $REQUEST_METHOD == "GET") {
- if ($cache = cache_get(request_uri())) {
- cache_clear_old();
- }
- else {
+ $cache = cache_get(request_uri());
+
+ if (empty($cache)) {
ob_start();
}
}
diff --git a/modules/system.module b/modules/system.module
index eafee55c5..6d70f9bfe 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -83,9 +83,7 @@ function system_view_general() {
// caching:
$output .= "<h3>". t("Cache settings") ."</h3>\n";
- $period = array(10 => format_interval(10), 20 => format_interval(20), 30 => format_interval(30), 40 => format_interval(40), 50 => format_interval(50), 50 => format_interval(50), 60 => format_interval(60), 90 => format_interval(90), 120 => format_interval(120), 150 => format_interval(150), 180 => format_interval(180), 210 => format_interval(210), 240 => format_interval(240), 270 => format_interval(270), 300 => format_interval(300), 360 => format_interval(360), 420 => format_interval(420), 480 => format_interval(480), 540 => format_interval(540), 600 => format_interval(600), 1800 => format_interval(1800), 3600 => format_interval(3600), 7200 => format_interval(7200));
- $output .= form_select(t("Cache support"), "cache", variable_get("cache", 0), array(t("Disabled"), t("Enabled")), t("Enable or disable the caching of pages."));
- $output .= form_select(t("Discard cached pages older than"), "cache_clear", variable_get("cache_clear", 120), $period, t("The time cached pages should be kept. Older pages are automatically refreshed."));
+ $output .= form_select(t("Cache support"), "cache", variable_get("cache", 0), array(t("Disabled"), t("Enabled")), t("Enable or disable the caching of rendered pages. When caching is enabled, Drupal will flush the cache when required to make sure updates take effect immediately."));
$output .= "<hr />\n";
// submission settings:
diff --git a/modules/system/system.module b/modules/system/system.module
index eafee55c5..6d70f9bfe 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -83,9 +83,7 @@ function system_view_general() {
// caching:
$output .= "<h3>". t("Cache settings") ."</h3>\n";
- $period = array(10 => format_interval(10), 20 => format_interval(20), 30 => format_interval(30), 40 => format_interval(40), 50 => format_interval(50), 50 => format_interval(50), 60 => format_interval(60), 90 => format_interval(90), 120 => format_interval(120), 150 => format_interval(150), 180 => format_interval(180), 210 => format_interval(210), 240 => format_interval(240), 270 => format_interval(270), 300 => format_interval(300), 360 => format_interval(360), 420 => format_interval(420), 480 => format_interval(480), 540 => format_interval(540), 600 => format_interval(600), 1800 => format_interval(1800), 3600 => format_interval(3600), 7200 => format_interval(7200));
- $output .= form_select(t("Cache support"), "cache", variable_get("cache", 0), array(t("Disabled"), t("Enabled")), t("Enable or disable the caching of pages."));
- $output .= form_select(t("Discard cached pages older than"), "cache_clear", variable_get("cache_clear", 120), $period, t("The time cached pages should be kept. Older pages are automatically refreshed."));
+ $output .= form_select(t("Cache support"), "cache", variable_get("cache", 0), array(t("Disabled"), t("Enabled")), t("Enable or disable the caching of rendered pages. When caching is enabled, Drupal will flush the cache when required to make sure updates take effect immediately."));
$output .= "<hr />\n";
// submission settings: