summaryrefslogtreecommitdiff
path: root/inc/cache.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/cache.php')
-rw-r--r--inc/cache.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/inc/cache.php b/inc/cache.php
index 01a305dfa..491fe1923 100644
--- a/inc/cache.php
+++ b/inc/cache.php
@@ -118,7 +118,8 @@ class cache {
}
/**
- * record cache hits statistics
+ * Record cache hits statistics.
+ * (Only when debugging allowed, to reduce overhead.)
*
* @param bool $success result of this cache use attempt
* @return bool pass-thru $success value
@@ -128,6 +129,8 @@ class cache {
static $stats = NULL;
static $file;
+ if (!$conf['allowdebug']) { return $success; }
+
if (is_null($stats)) {
$file = $conf['cachedir'].'/cache_stats.txt';
$lines = explode("\n",io_readFile($file));