]> git.mxchange.org Git - friendica.git/commitdiff
The caches are now cleared only once an hour.
authorMichael Vogel <icarus@dabo.de>
Tue, 25 Dec 2012 11:52:30 +0000 (12:52 +0100)
committerMichael Vogel <icarus@dabo.de>
Tue, 25 Dec 2012 11:52:30 +0000 (12:52 +0100)
include/poller.php
view/theme/vier/style.css

index 4eb5e8a2b912bd2b22df8cfec3c1822adbc9c1d1..113405dbbe79d33c2e0cf971b7d0e29d2fe5849e 100644 (file)
@@ -99,14 +99,26 @@ function poller_run(&$argv, &$argc){
                proc_run('php','include/expire.php');
        }
 
-       // clear old cache
-       Cache::clear();
+       $last = get_config('system','cache_last_cleared');
 
-       // clear old item cache files
-       clear_cache();
+       if($last) {
+               $next = $last + (3600); // Once per hour
+               $clear_cache = ($next <= time());
+        } else
+               $clear_cache = true;
 
-       // clear cache for photos
-       clear_cache($a->get_basepath(), $a->get_basepath()."/photo");
+       if ($clear_cache) {
+               // clear old cache
+               Cache::clear();
+
+               // clear old item cache files
+               clear_cache();
+
+               // clear cache for photos
+               clear_cache($a->get_basepath(), $a->get_basepath()."/photo");
+
+               set_config('system','cache_last_cleared', time());
+       }
 
        $manual_id  = 0;
        $generation = 0;
index ffd50ed1466d108f3c8c6f6d81248f3b310a1d10..5532c06eeed5bd560706fab8420f9b39ef4656b4 100644 (file)
@@ -1689,7 +1689,7 @@ div.pager, .birthday-notice, ul.tabs a, #jot-preview-link, .comment-edit-submit-
     border: 1px solid lightgray;
     color: black;
     background: #F2F2F2;
-    padding: 3px 7px 2px 7px;
+    padding: 2px 7px 2px 7px;
     margin-top: 2px;
     margin-bottom: 2px;