- Timestamp:
- 09/14/2016 02:06:10 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/classes/class-bp-activity-activity.php
r11054 r11101 646 646 $activity_ids_sql = apply_filters( 'bp_activity_paged_activities_sql', $activity_ids_sql, $r ); 647 647 648 $cached = bp_core_get_incremented_cache( $activity_ids_sql, 'bp_activity' ); 648 /* 649 * Queries that include 'last_activity' are cached separately, 650 * since they are generally much less long-lived. 651 */ 652 if ( preg_match( '/a\.type NOT IN \([^\)]*\'last_activity\'[^\)]*\)/', $activity_ids_sql ) ) { 653 $cache_group = 'bp_activity'; 654 } else { 655 $cache_group = 'bp_activity_with_last_activity'; 656 } 657 658 $cached = bp_core_get_incremented_cache( $activity_ids_sql, $cache_group ); 649 659 if ( false === $cached ) { 650 660 $activity_ids = $wpdb->get_col( $activity_ids_sql ); 651 bp_core_set_incremented_cache( $activity_ids_sql, 'bp_activity', $activity_ids );661 bp_core_set_incremented_cache( $activity_ids_sql, $cache_group, $activity_ids ); 652 662 } else { 653 663 $activity_ids = $cached; … … 709 719 */ 710 720 $total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(DISTINCT a.id) FROM {$bp->activity->table_name} a {$join_sql} {$where_sql}", $where_sql, $sort ); 711 $cached = bp_core_get_incremented_cache( $total_activities_sql, 'bp_activity');721 $cached = bp_core_get_incremented_cache( $total_activities_sql, $cache_group ); 712 722 if ( false === $cached ) { 713 723 $total_activities = $wpdb->get_var( $total_activities_sql ); 714 bp_core_set_incremented_cache( $total_activities_sql, 'bp_activity', $total_activities );724 bp_core_set_incremented_cache( $total_activities_sql, $cache_group, $total_activities ); 715 725 } else { 716 726 $total_activities = $cached;
Note: See TracChangeset
for help on using the changeset viewer.