/**
* @var boolean whether cache entry expiration time should be embedded into a physical file.
* Defaults to false meaning that the file modification time will be used to store expire value.
* True value means that first ten bytes of the file would be reserved and used to store expiration time.
* On some systems PHP is not allowed to change file modification time to be in future even with 777
* permissions, so this property could be useful in this case.
* @since 1.1.14
*/
public $embedExpiry=false;
protected function setValue($key,$value,$expire)
{
if(!$this->_gced && mt_rand(0,1000000)<$this->_gcProbability)
{
$this->gc();
$this->_gced=true;
}
if($expire<=0)
$expire=31536000; // 1 year
$expire+=time();
$cacheFile=$this->getCacheFile($key);
if($this->directoryLevel>0)
{
$cacheDir=dirname($cacheFile);
@mkdir($cacheDir,$this->cachePathMode,true);
@chmod($cacheDir,$this->cachePathMode);
}
if(@file_put_contents($cacheFile,$this->embedExpiry ? $expire.$value : $value,LOCK_EX)!==false)
{
@chmod($cacheFile,$this->cacheFileMode);
return $this->embedExpiry ? true : @touch($cacheFile,$expire); // <- HERE it sets the date in future
}
else
return false;
}
I see this uses ctime, which is creation time, so you delete files older than 30 days, which seems legit.And this is the cronjob they implemented on my server in order to remove old files, so that I stop having too many inodes after a while:
0 0 * * * find /home/parleran/Mailwizz/apps/common/runtime/cache -type f -ctime +30 -exec rm {} \;