[wp-trac] [WordPress Trac] #22176: Cache the results of the posts_request_ids query

WordPress Trac noreply at wordpress.org
Thu Sep 29 10:07:49 UTC 2022


#22176: Cache the results of the posts_request_ids query
-------------------------------------------------+-------------------------
 Reporter:  ryan                                 |       Owner:
                                                 |  peterwilsoncc
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.1
Component:  Query                                |     Version:  3.4.2
 Severity:  normal                               |  Resolution:
 Keywords:  needs-dev-note has-patch has-unit-   |     Focuses:
  tests add-to-field-guide                       |  performance
-------------------------------------------------+-------------------------

Comment (by spacedmonkey):

 In [changeset:"54352" 54352]:
 {{{
 #!CommitTicketReference repository="" revision="54352"
 Query: Save excessive cache add and sets in `WP_Query`.

 In [53941] database query caching was added to `WP_Query`. However on
 sites with persistent object caching enabled, this resulted in a high
 number of unnecessary cache set and adds being run on every request.
 Caches are not set, if the query cache already exists and is cached.
 Replace usage of `update_post_caches` with `_prime_post_caches` to ensure
 that only posts that are not in cache are primed.

 Props spacedmonkey, peterwilsoncc, mukesh27.
 See #22176.
 }}}

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


More information about the wp-trac mailing list