What is menu segment caching?
Menu Segment Caching allows you to cache the output of a Menu Segment as HTML stored as a transient in the database. When the menu is generated, a fast query is made to retrieve the markup for each submenu, bypassing the need for individual menu item queries and HTML generation.
How to use menu segment caching effectively
Generally the best way to leverage Menu Segment Caching is to use one Menu Segment for each submenu. This way, you can effectively cache each submenu independently. That means your top level items remain dynamic (features like current menu item, etc, will still work there), while you save processing in your submenus.
This is especially effective if you use Dynamic Items in your submenus, as it allows you to cache the results of those queries rather than re-running them every page load.
Configuring menu segment caching
The Menu Segment Caching feature allows you to enable the cache on individual menu segments, as well as set an expiration time. Access the settings in the UberMenu menu item settings for the [Menu Segment] items.
Enable the Cache Segment setting to cache the menu segment.
Cache Expiration
You can also set the cache expiration for each segment, in hours. By default, the cache will expire every 12 hours. If you instead want the menu segment to be regenerated once per day, for example, then you’d set the Cache Expiration to 24
.