public function purgeOldCache()
    {
        $cache_dir = dirname($this->cache_dir);
        $current = basename($this->cache_dir);
        $count = 0;

        foreach (new \DirectoryIterator($cache_dir) as $file) {
            $dir = $file->getBasename();
            if ($dir === $current || $file->isDot() || $file->isFile()) {
                continue;
            }

            Folder::delete($file->getPathname());
            $count++;
        }

        return $count;
    }