[buddypress-trac] [BuddyPress Trac] #6221: messages-loop.php executes BP_Messages_Thread::populate() twice per conversation

buddypress-trac noreply at wordpress.org
Sat Feb 14 01:33:40 UTC 2015


#6221: messages-loop.php executes BP_Messages_Thread::populate() twice per
conversation
--------------------------------------------+------------------
 Reporter:  wpdennis                        |       Owner:
     Type:  enhancement                     |      Status:  new
 Priority:  normal                          |   Milestone:  2.3
Component:  Component - Messaging           |     Version:
 Severity:  normal                          |  Resolution:
 Keywords:  dev-feedback reporter-feedback  |
--------------------------------------------+------------------

Comment (by boonebgorges):

 Looking a bit more closely at this, we should probably do the following:

 1. Create a separate `get_messages()` method, which is called from
 `populate()`.
 2. Cache the *IDs* of the thread's messages, and add the appropriate
 busting logic (namely, when adding a message to a thread, when deleting a
 message from a thread, or when deleting a thread).
 3. Cache individual messages individually. Then use our
 `bp_get_non_cached_ids()` logic to assemble a list of uncached messages,
 and get them in one fell swoop. (In other words, a split query.) This will
 allow us to use the same message cache (and invalidation logic) here and
 in `BP_Messages_Message`.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6221#comment:6>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list