Every time a menu item is added, there will be one more database query, so it is necessary to cache the menu.Here we recommend a menu caching plug-in, Menu Caching, which can be used together with other static caching plug-ins or used separately.
usage method:
After enabling the plug-in, enter WP background → Tools → Menu Caching.
Select the menu to be cached, or keep all menus cached by default.