How do you clear menu caches programmatically? I am developing a custom module. In this module, I want to delete menu caches programmatically. For this, I have used

\Drupal::cache('menu')-&gt;invalidateAll(); // for clearing the menu cache      
\Drupal::service('plugin.manager.menu.link')-&gt;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?
Menu's are displayed via blocks.  You will probably have to clear the block render cache as well.

\Drupal::cache('block')-&gt;invalidateAll();