[wp-trac] [WordPress Trac] #36905: Add caching to get_page_by_title

WordPress Trac noreply at wordpress.org
Sun Dec 16 02:30:59 UTC 2018


#36905: Add caching to get_page_by_title
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:  igmoweb
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Posts, Post Types                    |     Version:  2.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch good-first-bug has-unit-   |     Focuses:
  tests                                          |  performance
-------------------------------------------------+-------------------------

Comment (by pcfreak30):

 @spacedmonkey your patch looks nice however wp_query does cache with
 'cache_results' if wp_using_ext_object_cache() is true, so the extra cache
 check in your version is unneeded. Even with it, it only helps if doing
 memory caching, which is up for debate if the extra complexity matters vs
 using core wp_query.

 Also, I generally feel direct DB access for stuff like this should be
 avoided overall. We have a query system, it should be used if possible.

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


More information about the wp-trac mailing list