private function getCacheKey(RequestInterface $request, array $vary = [])
    {
        $key = $request->getMethod() . ' ' . $request->getUrl();

        // If Vary headers have been passed in, fetch each header and add it to
        // the cache key.
        foreach ($vary as $header) {
            $key .= " $header: " . $request->getHeader($header);
        }

        return $this->keyPrefix . md5($key);
    }