[wp-trac] [WordPress Trac] #22526: Changing category doesn't invalidate cache

WordPress Trac noreply at wordpress.org
Thu Feb 6 01:40:07 UTC 2014


#22526: Changing category doesn't invalidate cache
-----------------------------------------------+---------------------------
 Reporter:  Whissi                             |       Owner:
     Type:  defect (bug)                       |  wonderboymusic
 Priority:  normal                             |      Status:  closed
Component:  Cache API                          |   Milestone:  3.9
 Severity:  normal                             |     Version:  3.4.2
 Keywords:  needs-unit-tests has-patch commit  |  Resolution:  fixed
                                               |     Focuses:
-----------------------------------------------+---------------------------
Changes (by wonderboymusic):

 * owner:   => wonderboymusic
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"27101"]:
 {{{
 #!CommitTicketReference repository="" revision="27101"
 Add cache invalidation when updating a term, example: create a category,
 assign it to a post, edit the category. Currently, the post's term cache
 is not updated. When updating terms in a given taxonomy, invalidate the
 object term caches linked to that taxonomy.

 Introduce `get_taxonomy_last_changed()`, `set_taxonomy_last_changed()`,
 and `post_taxonomy_is_fresh()`.

 `post_taxonomy_is_fresh()` is only called in `get_object_term_cache()` -
 at which point the taxonomy's `last_changed` value is checked against the
 post's `{$taxonomy}_last_changed` value.

 `set_taxonomy_last_changed()` is called whenever directory database
 queries are made that insert new terms or affect existing terms.

 Fixes #22526.
 }}}

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


More information about the wp-trac mailing list