Problem/Motivation
RenderCache
does $cache_bin = $this->cacheFactory->get($bin)
. This is arguably a bug: how should it know that's how the cache.$bin
service is defined? In Drupal::cache()
we have the cache.$bin
service name codified.
Steps to reproduce
Two possible scenarios, I met both:
- if you override the cache.render service then RenderCache doesn't pick that change up.
- if within a request you override the cache settings for the render bin and cache.render is already initialized then RenderCache will pick your settings change up so you think your change is working -- until something else which uses cache.render points to a different backend...
Proposed resolution
Either
- change RenderCache to use the
cache.$bin
service - remove the factory from the yml files and have
ListCacheBinsPass
fill it in.