[wp-trac] [WordPress Trac] #24189: {$taxonomy}_relationships cache can easily become stale when a term is updated.

WordPress Trac noreply at wordpress.org
Thu Apr 25 11:18:16 UTC 2013


#24189: {$taxonomy}_relationships cache can easily become stale when a term is
updated.
--------------------------+-------------------
 Reporter:  westi         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  high          |  Milestone:  3.6
Component:  Taxonomy      |    Version:  trunk
 Severity:  major         |   Keywords:
--------------------------+-------------------
 The {{{{$taxonomy}_relationships}}} cache stores the information about the
 terms associated with an object for a particular taxonomy.

 If you update the term then we don't invalidate the cache and therefore a
 call to something like: {{{get_the_terms()}}} will return invalid data.

 An example set of steps to reproduce (needs some form of persistent
 caching like memcache):

  1) Create a new tag and assign it to a post
  2) Use get_the_terms()
  3) Edit the tag to change the description
  4) Use get_the_terms() and find the old description is returned.

 Very easy to reproduce in a unit-test.

 Re-constituting the relationships cache for every object that is related
 to the term is probably going to be very expensive.

 Maybe we should just switch to only caching IDs and then populating the
 term data from a different cache?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24189>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list