diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-03-16 21:49:33 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-03-16 21:49:33 +0000 |
commit | 2c0f3c9457b1de508b52b46c2a7bfadd364d0f03 (patch) | |
tree | 76fd48b448811c1e5624b9b863831a7f3b16a8c3 /includes/common.inc | |
parent | 297bc73f81441b13a2b1cdd49f471f9b20aa5271 (diff) | |
download | brdo-2c0f3c9457b1de508b52b46c2a7bfadd364d0f03.tar.gz brdo-2c0f3c9457b1de508b52b46c2a7bfadd364d0f03.tar.bz2 |
- Cache improvement: only flush cache when told to.
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 16 |
1 files changed, 3 insertions, 13 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(); } } |