I need to invalidate the block list cache each time a new configuration entity is created, this is because I have a derivative block to handle dynamically one block for each of my configuration entities. I tried to invalidate the block list with the following code


But when I go to see available blocks I'm not able to see my new block until I clean all the caches on the site.

Usually, when I need to invalidate entity lists from the cache I use the ENTITY-NAME_list tag to do it but this time is not working, maybe I'm missing something here?

1 Answer 1


Clearing the cache not only invalidates the render cache, but also a lot of other caches. For example all plugin manager discovery caches.

In this case you probably need to invalidate the cache of the block plugin manager:

  • Nice answer, I will keep this in mind for the future. Jun 22, 2021 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.