yii\caching\FileCache::gc PHP Метод

gc() публичный Метод

Removes expired cache files.
public gc ( boolean $force = false, boolean $expiredOnly = true )
$force boolean whether to enforce the garbage collection regardless of [[gcProbability]]. Defaults to false, meaning the actual deletion happens with the probability as specified by [[gcProbability]].
$expiredOnly boolean whether to removed expired cache files only. If false, all cache files under [[cachePath]] will be removed.
    public function gc($force = false, $expiredOnly = true)
    {
        if ($force || mt_rand(0, 1000000) < $this->gcProbability) {
            $this->gcRecursive($this->cachePath, $expiredOnly);
        }
    }