[buddypress-trac] [BuddyPress Trac] #4945: Add cache support to bp_get_option()

buddypress-trac noreply at wordpress.org
Sat Jun 7 20:16:16 UTC 2014


#4945: Add cache support to bp_get_option()
--------------------------+-----------------------------
 Reporter:  boonebgorges  |       Owner:  boonebgorges
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Core          |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  2nd-opinion   |
--------------------------+-----------------------------

Comment (by r-a-y):

 I set `BP_ENABLE_MULTIBLOG` to false, put a BP members widget on a
 secondary site and do not see any additional queries run against the
 `wp_X_options` table (where X is the `BP_ROOT_BLOG` id).

 > BP will be bootstrapped on all blogs if it's network activated.

 Yeah, object cache is already slurping up the queries.

 This query is run when there is no cache when on a secondary site:

 {{{
 SELECT option_name, option_value FROM wp_X_options WHERE autoload = 'yes'
             [1] => 0.0011401176452637
             [2] => buddypress, BuddyPress::instance, BuddyPress->includes,
 BuddyPress->versions, get_blog_option, get_option, wp_load_alloptions
 }}}

 Now, since the cache is primed, this query isn't run any more and
 subsequent calls to `bp_get_option()` will reference the cache.  Tested on
 WP 3.9.1.

 Is there a certain multisite setup where additional queries are being run
 on a secondary site when `bp_get_option()` is called?

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


More information about the buddypress-trac mailing list