Don't clear objectcache on every query, I doubt there was any good reason for doing so
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 27 Mar 2005 17:26:55 +0000 (17:26 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 27 Mar 2005 17:26:55 +0000 (17:26 +0000)
includes/ObjectCache.php

index b4bb22b..78ca511 100644 (file)
@@ -315,11 +315,14 @@ class SqlBagOStuff extends BagOStuff {
        }
        
        function garbageCollect() {
-               $nowtime = time();
-               /* Avoid repeating the delete within a few seconds */
-               if ( $nowtime > ($this->lastexpireall + 1) ) {
-                       $this->lastexpireall = $nowtime;
-                       $this->expireall();
+               /* Ignore 99% of requests */
+               if ( !mt_rand( 0, 100 ) ) {
+                       $nowtime = time();
+                       /* Avoid repeating the delete within a few seconds */
+                       if ( $nowtime > ($this->lastexpireall + 1) ) {
+                               $this->lastexpireall = $nowtime;
+                               $this->expireall();
+                       }
                }
        }