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

WordPress Trac noreply at wordpress.org
Wed Jul 27 17:04:17 UTC 2022

#22176: Cache the results of the posts_request_ids query
 Reporter:  ryan                                 |       Owner:
                                                 |  spacedmonkey
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.1
Component:  Query                                |     Version:  3.4.2
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch 2nd-opinion has-unit-      |     Focuses:
  tests early needs-testing needs-dev-note       |  performance

Comment (by spacedmonkey):

 Couple of other things to consider.

 There are plugins like [https://github.com/Automattic/advanced-post-cache
 advanced-post-cache] and [https://github.com/TimeIncUK/enhanced-post-cache
 Enhanced Post Cache] that already add caching to the WP_Query class. Both
 of which use the `posts_request_ids` filter to bypass the normal query. We
 maybe want to depercate this filter in the patch and recommend the use of
 `posts_pre_query` filter, which will play nicely with this change. Worse
 case, is that posts are double cached, by there maybe some issues there
 with cache invalidation.

 We maybe also want to consider plugins like elasticpress, that bypass
 normal queries using `posts_pre_query` and ensure that there are never

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

More information about the wp-trac mailing list