Skip to:
Content

BuddyPress.org

Changeset 1417


Ignore:
Timestamp:
04/28/2009 07:31:15 AM (15 years ago)
Author:
apeatling
Message:

Added avatar location caching.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r1416 r1417  
    13291329function bp_core_clear_user_object_cache( $user_id ) {
    13301330    wp_cache_delete( 'bp_user_' . $user_id, 'bp' );
     1331    wp_cache_delete( 'bp_core_avatar_v1_u' . $user_id, 'bp' );
     1332    wp_cache_delete( 'bp_core_avatar_v2_u' . $user_id, 'bp' );
    13311333    wp_cache_delete( 'online_users' );
    13321334    wp_cache_delete( 'newest_users' );
  • trunk/bp-core/bp-core-avatars.php

    r1366 r1417  
    3434        $height = constant('CORE_AVATAR_V' . $version . '_H');     
    3535   
    36     $avatar_file = get_usermeta( $user, "bp_core_avatar_v$version" );
     36    if ( !$avatar_file = wp_cache_get( 'bp_core_avatar_v' . $version . '_u' . $user, 'bp' ) ) {
     37        $avatar_file = get_usermeta( $user, 'bp_core_avatar_v' . $version );
     38        wp_cache_set( 'bp_core_avatar_v' . $version . '_u' . $user, $avatar_file, 'bp' );
     39    }
     40   
    3741    $url = $bp->root_domain . '/' . $avatar_file;
    3842   
Note: See TracChangeset for help on using the changeset viewer.