private function deleteCacheSubfolderRecursively($dir)
    {
        if (is_dir($dir)) {
            $objects = scandir($dir);
            foreach ($objects as $object) {
                if ($dir . DIRECTORY_SEPARATOR . $object == $this->cache_path) {
                    return false;
                } elseif ($object != '.' && $object != '..') {
                    if (is_writable($dir . DIRECTORY_SEPARATOR . $object)) {
                        if (is_dir($dir . DIRECTORY_SEPARATOR . $object)) {
                            $this->deleteCacheSubfolderRecursively($dir . DIRECTORY_SEPARATOR . $object);
                        } else {
                            unlink($dir . DIRECTORY_SEPARATOR . $object);
                        }
                    } else {
                        return false;
                    }
                }
            }

            if ($dir !== $this->cache_path) {
                rmdir($dir);
            }
        }
    }