[wp-trac] [WordPress Trac] #39382: Skipping term cache cleaning when cache invalidation is suspended

WordPress Trac noreply at wordpress.org
Fri Mar 17 01:58:10 UTC 2017


#39382: Skipping term cache cleaning when cache invalidation is suspended
--------------------------+--------------------------------
 Reporter:  zachop        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Cache API     |     Version:  4.3
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  docs, performance
--------------------------+--------------------------------
Changes (by boonebgorges):

 * keywords:  2nd-opinion => needs-patch


Comment:

 I've been thinking about this some more, and I'm less hopeful about the
 strategy of an uber-cache-invalidation method than I previously was.
 WordPress uses database-based "caching" in many places beyond what's
 described so far in this ticket. For example, the database schemas have
 columns built in - like `wp_posts.comment_count` and
 `wp_term_taxonomy.count` - which essentially serve a caching purpose.
 Invalidating all of these counts in one fell swoop could create serious
 stampede conditions, which would be more serious in a way than memory-
 based cache stampedes, since db i/o tends to be a more serious bottleneck.

 That said, I think it's a very good idea to improve documentation where
 possible. `wp_cache_flush()` is one place, but I'd suggest it's perhaps
 more important to add the necessary documentation to functions where
 invalidation suspension takes place, like `clean_term_cache()`. So, for
 example, `clean_term_cache()` should make clear that (a) term counts are
 not recalculated, while (b) term hierarchies *are* recalculated.

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


More information about the wp-trac mailing list