Set maxlife to 7 days & clear with cron
This commit is contained in:
parent
f927c8cf88
commit
7f2269c385
2 changed files with 5 additions and 1 deletions
|
@ -63,7 +63,7 @@ class AntCache
|
|||
return file_put_contents($cachePath, $content);
|
||||
case self::apcuCache:
|
||||
$apcuKey = $this->cacheKeyApcu . $key;
|
||||
return apcu_store($apcuKey, $content);
|
||||
return apcu_store($apcuKey, $content, 7 * 24 * 60 * 60); // Save it for one week.
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -5,3 +5,7 @@ $ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST)
|
|||
foreach ($ri as $file) {
|
||||
$file->isDir() ? rmdir($file->getRealPath()) : unlink($file->getRealPath());
|
||||
}
|
||||
|
||||
if (extension_loaded('apcu') && apcu_enabled()) {
|
||||
apcu_clear_cache();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue