public function getEndpointForUrl($url)
    {
        $cacheKey = sha1($url . $this->preferredFormat . json_encode($this->supportedFormats));

        if (!isset($this->cachedEndpoints[$url])) {
            $this->cachedEndpoints[$url] = $this->fetchEndpointForUrl($url);
            if (trim($this->cachedEndpoints[$url]) === '') {
                throw new Exception('Empty url endpoints', 1360175845);
            }
            $this->endPointCache->set($cacheKey, $this->cachedEndpoints[$url]);
        } elseif ($this->endPointCache->has($cacheKey) === true) {
            $this->cachedEndpoints[$url] = $this->endPointCache->get($cacheKey);
        }

        return $this->cachedEndpoints[$url];
    }