yii\caching\DbCache::gc PHP Method

gc() public method

Removes the expired data values.
public gc ( boolean $force = false )
$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]].
    public function gc($force = false)
    {
        if ($force || mt_rand(0, 1000000) < $this->gcProbability) {
            $this->db->createCommand()->delete($this->cacheTable, '[[expire]] > 0 AND [[expire]] < ' . time())->execute();
        }
    }