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

WordPress Trac noreply at wordpress.org
Mon Apr 17 23:25:34 UTC 2023


#58116: rest_{$this->taxonomy}_query Cache Problem
--------------------------+------------------------------------
 Reporter:  tnolte        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Taxonomy      |     Version:  6.0
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  rest-api, performance
--------------------------+------------------------------------

Comment (by peterwilsoncc):

 Replying to [comment:11 spacedmonkey]:
 > I am not sure, if we should fix this issue. Using filters in this way,
 it is pretty edge case and is somewhat brittle. I am not sure we can put a
 fix in place that would fix this forever and feels like we are more likely
 to break things, as this as been this way for 3 versions now.

 I think it needs to be fixed so the returned data is consistent. There are
 a few options:

 * similar to `WP_Query`, consider the result uncachable if the `SELECT`
 has been modified
 * cache `count` as returned from the DB query, if set, otherwise use the
 term's count column
 * always return the term's count column, whether cached or uncached

 I lean towards either the first or last option.

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


More information about the wp-trac mailing list