[wp-trac] [WordPress Trac] #56689: Use WP_Query in get_page_by_path

WordPress Trac noreply at wordpress.org
Mon Feb 6 00:26:36 UTC 2023


#56689: Use WP_Query in get_page_by_path
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:
                                                 |  spacedmonkey
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:
Component:  Query                                |     Version:  trunk
 Severity:  normal                               |  Resolution:  wontfix
 Keywords:  needs-testing has-patch has-unit-    |     Focuses:
  tests has-testing-info 2nd-opinion             |  performance
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 The advantage of using `WP_Query` is that it hits the lower level cache,
 ideally increasing cache hits for various purposes.

 The approaches in the most recent patches end up double caching, so the
 advantage is lost and using the simplest code seems the best approach.
 That being the code in it's current, committed form.

 I experimented a little with a cache key collision before realising that
 was a terrible idea because it would be too easy for a future developer
 miss updating cache objects in multiple locations. Not all my ideas can be
 winners ;)

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


More information about the wp-trac mailing list