Here's what I'm noticing:
I set the cache array to what I want it to be in my block
It propagates up to BlockViewBuilder.php and gets put into the
There is still a
#cachearray on the $build itself, which by default has three contexts:
array('languages:language_interface', 'theme', 'user.permissions')
I want to get rid of the languages and user.permissions contexts for my block, because they shouldn't affect its content and I don't want the two contexts to have inconsistent data, but setting my block's contexts won't affect the ones set by the top level $build object. Is there a way for me to do that?
It looks like CacheableMetadata::createFromRenderArray() will try to merge the two #cache arrays, but from the way it's doing it, it seems it will grab unique values from the two arrays. Is there a place where I can remove the bad contexts?