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

WordPress Trac noreply at wordpress.org
Fri Jul 15 01:25:16 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
-------------------------------------------------+-------------------------
Changes (by peterwilsoncc):

 * keywords:  has-patch 2nd-opinion has-unit-tests early needs-testing =>
     has-patch 2nd-opinion has-unit-tests early needs-testing needs-dev-
     note


Comment:

 At a technical level, I agree with @spacedmonkey that this patch is
 getting very close.

 A final decision to be made is to decide upon the default setting for
 caching, `post_query_cache`:

 * always on: `true`
 * always off: `false` -- with core functions updated to default on
 * conditionally `true`

 The sticking point of always `true` is that some plugins and/or custom WP-
 CLI commands may be expecting an uncached value. The simplest example of
 this is a custom importer that uses WPDB rather than `wp_insert_post()`.

 Discussing this issue with Jonny, our current thinking is that
 conditionally defaulting to enable the cache is probably the best option.
 Certainly as an initial step.

 A dev note would be required to advice developers to use this flag.

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


More information about the wp-trac mailing list