I am developing a custom module. In this module, I want to delete menu caches programmatically. For this, I have used
\Drupal::cache('menu')->invalidateAll(); // for clearing the menu cache \Drupal::service('plugin.manager.menu.link')->rebuild(); // rebuild the menu
But somehow, menu cache seems not being cleared and still the old menu is being displayed. How can I force Drupal to have my updated menu being displayed?