Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/11/2011 04:58:11 PM (12 years ago)
Author:
boonebgorges
Message:

Collect and cache activity meta at the beginning of the activity loop, for quicker lookups. Fixes #3814

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-functions.php

    r5437 r5505  
    483483
    484484    // Delete cache entry
    485     wp_cache_delete( 'bp_activity_meta_' . $meta_key . '_' . $activity_id, 'bp' );
     485    wp_cache_delete( 'bp_activity_meta_' . $activity_id . '_' . $meta_key, 'bp' );
    486486
    487487    // Success
     
    524524
    525525        // Check cache
    526         if ( !$metas = wp_cache_get( 'bp_activity_meta_' . $meta_key . '_' . $activity_id, 'bp' ) ) {
     526        if ( !$metas = wp_cache_get( 'bp_activity_meta_' . $activity_id . '_' . $meta_key, 'bp' ) ) {
     527            var_dump( 'miss' );
    527528
    528529            // No cache so hit the DB
     
    530531
    531532            // Set cache
    532             wp_cache_set( 'bp_activity_meta_' . $meta_key . '_' . $activity_id, $metas, 'bp' );
     533            wp_cache_set( 'bp_activity_meta_' . $activity_id . '_' . $meta_key, $metas, 'bp' );
    533534        }
    534535
     
    606607
    607608    // Set cache
    608     wp_cache_set( 'bp_activity_meta_' . $meta_key . '_' . $activity_id, $meta_value, 'bp' );
     609    wp_cache_set( 'bp_activity_meta_' . $activity_id . '_' . $meta_key, $meta_value, 'bp' );
    609610
    610611    // Victory is ours!
Note: See TracChangeset for help on using the changeset viewer.