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

WordPress Trac noreply at wordpress.org
Wed Jun 21 21:13:15 UTC 2017


#22176: Cache the results of the posts_request_ids query
-------------------------------------------------+-------------------------
 Reporter:  ryan                                 |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  Query                                |  Release
 Severity:  normal                               |     Version:  3.4.2
 Keywords:  has-patch needs-unit-tests 2nd-      |  Resolution:
  opinion                                        |     Focuses:
                                                 |  performance
-------------------------------------------------+-------------------------
Changes (by spacedmonkey):

 * keywords:  has-patch needs-refresh => has-patch needs-unit-tests 2nd-
     opinion


Comment:

 I have spent sometime on this ticket as I think it is much simpler that
 originally thought.

 - The cache key generated has the post types array. The idea behind this
 is when new post types are registered caches are cleared.
 - The fields element is removed, so that all formats are wp query are
 stored in the same cache as a list of ids.
 - The return points from id and id=>parent formats have been changed. This
 makes code a little cleaner. It also means that all the filters are fired
 more, making this code much more hackable.
 - I have reused the cache_filter param and changed what it is used for. I
 believe this is a nice solution.
 - Added a param update_post_cache, bring query class into line with other
 newer query classes like wp_site_query.

 I am worried about how filters effect this code. This code has tonnes of
 filters, any of which may break the caching. Currently none of the core
 tests are failing.

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


More information about the wp-trac mailing list