[wp-trac] [WordPress Trac] #27120: Add object cache to wp_nav_menu() items

WordPress Trac noreply at wordpress.org
Wed Mar 5 01:31:49 UTC 2014


#27120: Add object cache to wp_nav_menu() items
-----------------------------------+------------------------------------
 Reporter:  Clorith                |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Menus                  |     Version:  3.8
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:  template, performance
-----------------------------------+------------------------------------
Changes (by nacin):

 * keywords:  has-patch dev-feedback => has-patch 2nd-opinion
 * milestone:  3.9 => Awaiting Review


Comment:

 I'm not entirely sure I see the bug here. Or rather, I'm not sure the
 solution is the best way to reduce queries.

 The queries I see are in wp_get_nav_menu_object(), which uses get_term()
 or get_term_by() (one of which is cached, the other will be in #21760);
 and in wp_get_nav_menu_items(), which uses get_objects_in_term(), which
 could be switched to a higher-level function that performs caching first.

 get_posts() and get_terms() have their own caches to some extent. The
 get_posts() call could be moved to a _prime_post_caches() call instead.

 I don't think we need to blindly cache menus; deeper improvements could go
 a long way. (As Sergey said, these would changes would require cache
 invalidation.)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27120#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list