[wp-hackers] Question on Nav speed
jdg at codesymphony.co
Sat Apr 29 11:00:22 UTC 2017
This is a good place to use fragment caching. Since menus don't change very often, just cache the entire rendered menu in a transient. I think there are plugins that do this out there. See for example https://github.com/Rarst/fragment-cache <https://github.com/Rarst/fragment-cache>
> On Apr 29, 2017, at 12:48 AM, Luke Bryan <lukebryan at sharefaith.com> wrote:
> Greetings all,
> I have noticed that in profiling Wordpress, wp_get_nav_menu_items() seems
> to be a slow function overall in any given page load. Looking through
> tickets, it seems others would agree...
> It *needs caching*:
> Saving menus apparently can be slow and we shouldn't "call
> wp_get_nav_menu_items() in wp_update_nav_menu_item() unless we need to.
> I was wondering if there is any recommendation for optimizing the navs or
> if there's anything in-the-works that would improve performance without,
> say, adding a site cache plugin?
> Best regards,
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers