[wp-trac] [WordPress Trac] #64696: Real time collboration effectively disables persistent post caches while anyone edits a post

WordPress Trac noreply at wordpress.org
Mon Feb 23 02:36:56 UTC 2026


#64696: Real time collboration effectively disables persistent post caches while
anyone edits a post
-------------------------------+--------------------------
 Reporter:  peterwilsoncc      |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  7.0
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:  performance
-------------------------------+--------------------------

Comment (by westonruter):

 Oh, that's not good. It seems this is due to
 `WP_Sync_Post_Meta_Storage::add_update()` calling `add_post_meta()` which
 ends up triggering a `added_post_meta` action, and in `default-
 filters.php` the `wp_cache_set_posts_last_changed()` function is hooked to
 run when `added_post_meta` fires.

 Similarly, when `WP_Sync_Post_Meta_Storage::set_awareness_state()` is
 called, it calls `update_post_meta()` which will end up triggering the
 `updated_post_meta` action, and `wp_cache_set_posts_last_changed()` also
 runs when that happens.

 To work around this, we could temporarily unhook these when the post meta
 is added or updated:

 {{{
 add_action( 'added_post_meta', 'wp_cache_set_posts_last_changed' );
 add_action( 'updated_post_meta', 'wp_cache_set_posts_last_changed' );
 }}}

 This presumes that changes to this postmeta will not impact any related
 caches (which I presume they wouldn't).

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


More information about the wp-trac mailing list