[wp-trac] [WordPress Trac] #64916: Real-time collaboration: per-object meta cache invalidated on every sync and awareness write

WordPress Trac noreply at wordpress.org
Fri Mar 20 17:37:41 UTC 2026


#64916: Real-time collaboration: per-object meta cache invalidated on every sync
and awareness write
--------------------------+-----------------------------
 Reporter:  JoeFusco      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:  performance   |
--------------------------+-----------------------------
 `add_post_meta()` unconditionally calls `wp_cache_delete( $object_id,
 'post_meta' )` inside `add_metadata()` ([https://github.com/WordPress
 /wordpress-develop/blob/5f2be9e5a5bb4bed05fd997df8de11335b442c65/src/wp-
 includes/meta.php#L145 meta.php:145]). `update_post_meta()` does the same.

 The sync storage class stores both sync updates and awareness state as
 post meta on the same storage post per room. Every sync write and every
 awareness write (1-4x/sec per editor) invalidates the entire per-object
 meta cache for that post. The next `get_post_meta()` call for awareness
 misses cache and hits the database, even when awareness data hasn't
 changed.

 This is distinct from the site-wide `wp_cache_set_posts_last_changed()`
 invalidation in #64696. That affects `WP_Query` caches globally. This
 affects per-object meta caches, forcing unnecessary database reads on
 every poll cycle.

 See #64696 [https://core.trac.wordpress.org/ticket/64696#comment:117
 comment:117].

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


More information about the wp-trac mailing list