[buddypress-trac] [BuddyPress] #3770: Support object cache in groups_get_group(), and use it instead of directly instantiating BP_Groups_Group

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Sat Nov 26 17:28:21 UTC 2011


#3770: Support object cache in groups_get_group(), and use it instead of directly
instantiating BP_Groups_Group
--------------------------+------------------------------------
 Reporter:  boonebgorges  |      Owner:  boonebgorges
     Type:  enhancement   |     Status:  new
 Priority:  major         |  Milestone:  1.6
Component:  Groups        |    Version:
 Severity:  normal        |   Keywords:  has-patch dev-feedback
--------------------------+------------------------------------
 See #3758.

 BP functions that directly instantiate BP_Groups_Group (for instance,
 bp_the_topic_object_avatar()) can be wasteful when run many times on a
 single load. Not to mention that we have no support for persistent caches
 for objects that, for the most part, are quite static over time.

 The attached patch is a first pass at cache support. It does the
 following:
 - Adds support for the WP cache to groups_get_group()
 - Swaps out most existing instantiations of BP_Groups_Group with
 groups_get_group()
 - Adds a bit of cache-busting logic to methods of BP_Groups_Group,
 especially for those using object cache plugins.

 In my testing, this patch can shave up to 50 queries off of a single page
 load!

 Thoughts or feedback?

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3770>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list