$this->cacheBackend =
$cache_backend;
} /**
* {@inheritdoc}
*/
public function fetchResource($url) { $cache_id = "media:oembed_resource:
$url";
$cached =
$this->cacheBackend->
get($cache_id);
if ($cached) { return $this->
createResource($cached->data,
$url);
} try { $response =
$this->httpClient->
request('GET',
$url,
[ RequestOptions::TIMEOUT => 5,
]);
} catch (TransferException
$e) { throw new ResourceException('Could not retrieve the oEmbed resource.',
$url,
[],
$e);
} [