Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294215

RenderCache violates the "single responsibility" principle

$
0
0

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:

  1. if you override the cache.render service then RenderCache doesn't pick that change up.
  2. 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

  1. change RenderCache to use the cache.$bin service
  2. remove the factory from the yml files and have ListCacheBinsPass fill it in.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 294215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>