Add service tag(s) for cache clearing

Created on 25 July 2024, 5 months ago
Updated 19 September 2024, 3 months ago

Problem/Motivation

Follow-up from πŸ› Single directory component CSS asset library not picked up in admin theme immediately after module install without cache clear Active .

ModuleInstaller::instal() and drupal_flush_all_caches() both manually call various service cache clearing methods, such as \Drupal::getContainer()->get('plugin.cache_clearer')->clearCachedDefinitions();

Module install doesn't call drupal_flush_all_caches() because it tries to be selective about which caches it clears to avoid cold starts, so we have duplicated and subtly different logic between the two.

For module install, we could have a service tag + interface, so that plugin.cache_clearer and library.discovery can subscribe to the tag and have their caches cleared automatically. We could also do the same thing in drupal_flush_all_caches().

Not sure if we also need a 'flush all caches' tag for the things that are different too.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Needs review

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 9 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024