Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/19/2009 01:35:32 PM (16 years ago)
Author:
apeatling
Message:

Added basic object caching support ready for the first release. This will cut the number of database calls and load by 3x. Add define( 'WP_CACHE', true ); to you wp-config.php and drop object-cache.php into /wp-content/ to enable.

A good file based object cache is available here:
http://neosmart.net/dl.php?id=14

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-adminbar.php

    r1209 r1238  
    126126   
    127127        if ( function_exists('bp_blogs_install') ) {
    128             $blogs = get_blogs_of_user( $bp->loggedin_user->id ); // find *all* blogs with any kind of role
     128           
     129            if ( !$blogs = wp_cache_get( 'bp_user_blogs_' . $bp->loggedin_user->id, 'bp' ) ) {
     130                $blogs = get_blogs_of_user( $bp->loggedin_user->id );
     131                wp_cache_set( 'bp_user_blogs_' . $bp->loggedin_user->id, $blogs, 'bp' );
     132            }
    129133
    130134            echo '<li id="bp-adminbar-blogs-menu"><a href="' . $bp->loggedin_user->domain . $bp->blogs->slug . '/my-blogs">';
Note: See TracChangeset for help on using the changeset viewer.