public function generate($data)
    {
        if ($data instanceof InfoProviderInterface) {
            $data = $data->getCacheKeyInfo();
        }

        if ($this->converter && !is_string($data)) {
            $convertedData = $this->converter->convert($data);
            if ($convertedData === false) {
                throw new InvalidArgumentException($data);
            }

            $data = $convertedData;
        } elseif (!is_string($data)) {
            throw new InvalidArgumentException($data);
        }

        $cacheKey = $this->normalizer->normalize($data);

        if ($this->prefix) {
            return $this->prefix . $cacheKey;
        }

        return $cacheKey;
    }