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

WordPress Trac noreply at wordpress.org
Fri Dec 23 16:15:43 UTC 2016


#39382: Skipping term cache cleaning when cache invalidation is suspended
-------------------------------+-----------------------------
 Reporter:  zachop             |      Owner:
     Type:  enhancement        |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Cache API          |    Version:  4.3
 Severity:  normal             |   Keywords:
  Focuses:  docs, performance  |
-------------------------------+-----------------------------
 Since v4.3, `clean_term_cache` checks if cache invalidation is suspended,
 and bails early if it is.

 This behavior might be a bit obscure and unexpected, based on the
 documentation of `wp_suspend_cache_invalidation`.

 I understand that the responsibility of ensuring that the cache is
 properly invalidated falls on the caller of
 `wp_suspend_cache_invalidation`, according to the Codex, but I believe
 that the word "''cache''" can be easily misinterpreted as the ''object
 cache'', not including the (persistent) ''term cache''.

 Furthermore, even if persistent caches are not invalidated during
 invalidation suspension, there should probably be a simple function call
 to purge them all at once. One might suggest using `wp_cache_flush`, as
 its description states that it "''removes all cache items''", but that is
 also not exactly true, since the word "''cache''" does refer to the object
 cache at this point (expluding persistent caches, e.g. the term cache).

 I don't exactly think of this as a bug, and I can imagine the performance-
 related considerations and decisions that led to that behavior. I just
 believe that, even if nothing changes, a more detailed description of
 `wp_suspend_cache_invalidation` and `wp_cache_flush` would be really
 helpful.

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


More information about the wp-trac mailing list