[wp-trac] [WordPress Trac] #58116: rest_{$this->taxonomy}_query Cache Problem

WordPress Trac noreply at wordpress.org
Thu Jul 20 12:18:14 UTC 2023


#58116: rest_{$this->taxonomy}_query Cache Problem
-------------------------------------------------+-------------------------
 Reporter:  tnolte                               |       Owner:
                                                 |  spacedmonkey
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.4
Component:  Taxonomy                             |     Version:  6.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-refresh needs-unit-  |     Focuses:  rest-api,
  tests                                          |  performance
-------------------------------------------------+-------------------------

Comment (by spacedmonkey):

 @tnolte As this is custom code, could you try the following.

 - Use `terms_pre_query` to return a custom results.
 - Make `'term-queries'` cache group none persistent, meaning caching would
 be disabled.
 - Use the `get_term` filter and change the properties of the WP_Term
 object.

 The change is WP 6.0 was a valid one. It is bad to store the whole object
 in cache. It waste lots of space in cache. I am not personally sure this
 is a use case this use case as there are number ways to work around this,
 see above.

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


More information about the wp-trac mailing list