[wp-trac] [WordPress Trac] #55999: wp_suspend_cache_addition should also disable cache setting?

WordPress Trac noreply at wordpress.org
Fri Jun 17 13:33:27 UTC 2022

#55999: wp_suspend_cache_addition should also disable cache setting?
 Reporter:  malthert                             |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Cache API                            |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-unit-tests 2nd-      |     Focuses:
  opinion                                        |  performance
Changes (by johnbillion):

 * keywords:  has-patch => has-patch needs-unit-tests 2nd-opinion
 * focuses:   => performance
 * version:  trunk =>


 This is a good idea but it is a breaking change. During a large import for
 example, suspending cache addition makes sense to avoid consuming a large
 amount of memory (particularly when inserting terms and post meta), but
 updating existing cache entries may well be desirable and expected.

 I'll see if I can find some concrete examples.

 I think to avoid backwards compatibility issues this needs to be
 implemented via a new function such as `wp_suspend_cache_changes()`.

 Either way, it would be good to get test coverage on this too.

Ticket URL: <https://core.trac.wordpress.org/ticket/55999#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list