Change record status: 
Project: 
Introduced in branch: 
8.x
Introduced in version: 
8.0.0-alpha14
Description: 

Plugin managers utilize caching to prevent reparsing of their plugin definitions on every request.
The CachedDiscoveryInterface allows external code to clear their caches, but there needs to be a way for calling code to clear the caches of all plugin managers at once, like during module installation.

Any plugin manager that has a service ID starting with plugin.manager. will be automatically included in this list.

If a plugin manager has an custom service ID that does not meet that pattern, it can use the plugin_manager_cache_clear tag:

  entity.manager:
    class: Drupal\Core\Entity\EntityManager
    arguments: ['@container.namespaces', '@service_container', '@module_handler', '@cache.cache', '@language_manager', '@string_translation']
    tags:
      - { name: plugin_manager_cache_clear }
Impacts: 
Module developers