[buddypress-trac] [BuddyPress] #4076: Use transients for expensive activity queries

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Tue Mar 13 19:48:27 UTC 2012


#4076: Use transients for expensive activity queries
--------------------------+----------------------------
 Reporter:  boonebgorges  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Future Release
Component:  Activity      |    Version:
 Severity:  normal        |   Keywords:  dev-feedback
--------------------------+----------------------------
 In light of tickets like #4045, I would like to suggest that we implement
 some smarter caching of popular and complex activity queries. wp_cache is
 nice, but it will have no effect on someone not using a persistent object
 cache. Using transients, on the other hand, will have a small cost in
 terms of database storage, but a potentially huge payoff even for
 installations on relatively modest setups.

 So, here's what I'm thinking. Cache at the level of bp_has_activities().
 Pass everything through a wrapper function (like
 bp_update_activity_transient()), which will allow admins/plugin devs to
 decide just how many different kinds of activity queries get cached in
 this way. By default, cache the following:
 - The main activity stream firehose, maybe through the first five pages
 - The main activity stream filters (New Blog Post, Updates, etc), first
 couple pages
 - Each user's activity stream, first couple pages
 - Each group's activity stream, first couple pages

 We can build transient keys out of a hash of the relevant
 bp_has_activities() parameters.

 I will build a proof-of-concept, but I wanted to get feedback as well
 before digging in too deeply. Thanks.

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


More information about the buddypress-trac mailing list