protected function flushOldCache()
    {
        do_action("before_theme_flush_old_cache");

        $files = glob($this->cachePath . "*");
        $files = (is_array($files) && $files ? $files : array());

        $cache_config = $this->getConfig("cache");

        foreach ($files as $file):
            if (file_exists($file) && (time() - filemtime($file) > $cache_config["lifetime"])):
                unlink($file);
            endif;
        endforeach;

        do_action("after_ntl_flush_old_cache");
    }