The media system has three services which, together, provide oEmbed support:
\Drupal\media\OEmbed\ResourceFetcher
\Drupal\media\OEmbed\ProviderRepository
\Drupal\media\OEmbed\UrlResolver
Previously, each of these services took an optional $cache_backend parameter, which could be NULL or an instance of \Drupal\Core\Cache\CacheBackendInterface
. They used \Drupal\Core\Cache\UseCacheBackendTrait
so that calling code could enable/disable caching.
As of #3222632: oEmbed services' cache backends should not be optional, the cache backend must always be provided, and the services no longer use UseCacheBackendTrait
. To disable caching, pass an instance of \Drupal\Core\Cache\NullBackend
. Subclasses should directly call $this->cacheBackend->get()
and $this->cacheBackend->set()
respectively.