[buddypress-trac] [BuddyPress Trac] #6327: Improved caching for group membership

buddypress-trac noreply at wordpress.org
Sat May 21 02:16:38 UTC 2016


#6327: Improved caching for group membership
--------------------------------+------------------
 Reporter:  boonebgorges        |       Owner:
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  2.6
Component:  Component - Groups  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:                      |
--------------------------------+------------------

Comment (by boonebgorges):

 In [changeset:"10794"]:
 {{{
 #!CommitTicketReference repository="" revision="10794"
 Introduce caching for group memberships.

 The new system works like this: The `bp_groups_memberships_for_user` cache
 group stores arrays of membership IDs for individual users. The
 `bp_groups_memberships` cache group stores data about individual
 memberships.
 The new function `bp_get_user_groups()` populates a user's group
 memberships
 from these caches, and filters them as requested in the function
 parameters.
 Then, the various `groups_is_user_*()` functions use
 `bp_get_user_groups()`
 instead of direct, uncached database queries to fetch their data.

 In addition, the `get_group_extras()` method of `BP_Groups_Group` can now
 be
 greatly simplified, since all necessary pre-fetching of current-user group
 memberships happens via the `bp_get_user_groups()` cache.

 Props boonebgorges, dcavins.
 See #6327.
 }}}

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


More information about the buddypress-trac mailing list