I want to execute code before cache is cleared, for example for the menu cache:
// Clear menu cache $cache = \Drupal::cache('menu'); $cache->deleteAll();
I want to intervene when the cache clear is called, right before it is deleted. I've read the documentation on Drupal::cache and the Cache API but didn't find a solution. Do note that I want to do this using core code only, no contributed modules.
::deleteMultiplewhich is where it would need to happen
standard.links.menu.ymland adding it with
MenuLinkContent::create()instead. And now we need an upgrade path.