Index: src/bp-activity/bp-activity-admin.php
===================================================================
--- src/bp-activity/bp-activity-admin.php
+++ src/bp-activity/bp-activity-admin.php
@@ -542,7 +542,7 @@
 		$result = $activity->save();
 
 		// Clear the activity stream first page cache, in case this activity's timestamp was changed
-		wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+		bp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
 
 		// Check for any error during activity save
 		if ( false === $result )
Index: src/bp-activity/bp-activity-cache.php
===================================================================
--- src/bp-activity/bp-activity-cache.php
+++ src/bp-activity/bp-activity-cache.php
@@ -42,7 +42,7 @@
  * @param BP_Activity_Activity $activity
  */
 function bp_activity_clear_cache_for_activity( $activity ) {
-	wp_cache_delete( $activity->id, 'bp_activity' );
+	bp_cache_delete( $activity->id, 'bp_activity' );
 }
 add_action( 'bp_activity_after_save', 'bp_activity_clear_cache_for_activity' );
 
@@ -55,7 +55,7 @@
  */
 function bp_activity_clear_cache_for_deleted_activity( $deleted_ids ) {
 	foreach ( (array) $deleted_ids as $deleted_id ) {
-		wp_cache_delete( $deleted_id, 'bp_activity' );
+		bp_cache_delete( $deleted_id, 'bp_activity' );
 	}
 }
 add_action( 'bp_activity_deleted_activities', 'bp_activity_clear_cache_for_deleted_activity' );
Index: src/bp-activity/bp-activity-classes.php
===================================================================
--- src/bp-activity/bp-activity-classes.php
+++ src/bp-activity/bp-activity-classes.php
@@ -137,12 +137,12 @@
 	public function populate() {
 		global $wpdb, $bp;
 
-		$row = wp_cache_get( $this->id, 'bp_activity' );
+		$row = bp_cache_get( $this->id, 'bp_activity' );
 
 		if ( false === $row ) {
 			$row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE id = %d", $this->id ) );
 
-			wp_cache_set( $this->id, $row, 'bp_activity' );
+			bp_cache_set( $this->id, $row, 'bp_activity' );
 		}
 
 		if ( ! empty( $row ) ) {
@@ -645,13 +645,13 @@
 			// Put that data into the placeholders created earlier,
 			// and add it to the cache
 			foreach ( (array) $queried_adata as $adata ) {
-				wp_cache_set( $adata->id, $adata, 'bp_activity' );
+				bp_cache_set( $adata->id, $adata, 'bp_activity' );
 			}
 		}
 
 		// Now fetch data from the cache
 		foreach ( $activity_ids as $activity_id ) {
-			$activities[] = wp_cache_get( $activity_id, 'bp_activity' );
+			$activities[] = bp_cache_get( $activity_id, 'bp_activity' );
 		}
 
 		// Then fetch user data
@@ -1269,7 +1269,7 @@
 			$top_level_parent_id = $activity_id;
 		}
 
-		$comments = wp_cache_get( $activity_id, 'bp_activity_comments' );
+		$comments = bp_cache_get( $activity_id, 'bp_activity_comments' );
 
 		// We store the string 'none' to cache the fact that the
 		// activity item has no comments
@@ -1394,7 +1394,7 @@
 				$cache_value = $comments;
 			}
 
-			wp_cache_set( $activity_id, $cache_value, 'bp_activity_comments' );
+			bp_cache_set( $activity_id, $cache_value, 'bp_activity_comments' );
 		}
 
 		return $comments;
Index: src/bp-activity/bp-activity-functions.php
===================================================================
--- src/bp-activity/bp-activity-functions.php
+++ src/bp-activity/bp-activity-functions.php
@@ -1396,8 +1396,8 @@
  * @see BP_Activity_Activity::get() For more information on accepted arguments
  *      and the format of the returned value.
  * @uses wp_parse_args()
- * @uses wp_cache_get()
- * @uses wp_cache_set()
+ * @uses bp_cache_get()
+ * @uses bp_cache_set()
  * @uses BP_Activity_Activity::get() {@link BP_Activity_Activity}
  * @uses apply_filters_ref_array() To call the 'bp_activity_get' hook.
  *
@@ -1441,7 +1441,7 @@
 	// Attempt to return a cached copy of the first page of sitewide activity.
 	if ( ( 1 === (int) $r['page'] ) && empty( $r['max'] ) && empty( $r['search_terms'] ) && empty( $r['meta_query'] ) && empty( $r['date_query'] ) && empty( $r['filter_query'] ) && empty( $r['filter'] ) && empty( $r['scope'] )&& empty( $r['exclude'] ) && empty( $r['in'] ) && ( 'DESC' === $r['sort'] ) && empty( $r['exclude'] ) && ( 'ham_only' === $r['spam'] ) ) {
 
-		$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' );
+		$activity = bp_cache_get( 'bp_activity_sitewide_front', 'bp' );
 		if ( false === $activity ) {
 
 			$activity = BP_Activity_Activity::get( array(
@@ -1462,7 +1462,7 @@
 				'count_total'       => $r['count_total'],
 			) );
 
-			wp_cache_set( 'bp_activity_sitewide_front', $activity, 'bp' );
+			bp_cache_set( 'bp_activity_sitewide_front', $activity, 'bp' );
 		}
 
 	} else {
@@ -1561,7 +1561,7 @@
  * @uses wp_parse_args()
  * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
  * @uses BP_Activity_Activity::rebuild_activity_comment_tree() {@link BP_Activity_Activity}
- * @uses wp_cache_delete()
+ * @uses bp_cache_delete()
  * @uses do_action() To call the 'bp_activity_add' hook
  *
  * @param array $args {
@@ -1646,12 +1646,12 @@
 	// If this is an activity comment, rebuild the tree
 	if ( 'activity_comment' === $activity->type ) {
 		// Also clear the comment cache for the parent activity ID
-		wp_cache_delete( $activity->item_id, 'bp_activity_comments' );
+		bp_cache_delete( $activity->item_id, 'bp_activity_comments' );
 
 		BP_Activity_Activity::rebuild_activity_comment_tree( $activity->item_id );
 	}
 
-	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+	bp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
 
 	/**
 	 * Fires at the end of the execution of adding a new activity item, before returning the new activity item ID.
@@ -2002,7 +2002,7 @@
  * @uses bp_activity_add()
  * @uses apply_filters() To call the 'bp_activity_comment_action' hook.
  * @uses apply_filters() To call the 'bp_activity_comment_content' hook.
- * @uses wp_cache_delete()
+ * @uses bp_cache_delete()
  * @uses do_action() To call the 'bp_activity_comment_posted' hook.
  *
  * @param array $args {
@@ -2086,16 +2086,16 @@
 	) );
 
 	// Comment caches are stored only with the top-level item
-	wp_cache_delete( $activity_id, 'bp_activity_comments' );
+	bp_cache_delete( $activity_id, 'bp_activity_comments' );
 
 	// Walk the tree to clear caches for all parent items
 	$clear_id = $r['parent_id'];
 	while ( $clear_id != $activity_id ) {
 		$clear_object = new BP_Activity_Activity( $clear_id );
-		wp_cache_delete( $clear_id, 'bp_activity' );
+		bp_cache_delete( $clear_id, 'bp_activity' );
 		$clear_id = intval( $clear_object->secondary_item_id );
 	}
-	wp_cache_delete( $activity_id, 'bp_activity' );
+	bp_cache_delete( $activity_id, 'bp_activity' );
 
 	/**
 	 * Fires near the end of an activity comment posting, before the returning of the comment ID.
@@ -2185,7 +2185,7 @@
  * @uses bp_delete_user_meta()
  * @uses do_action() To call the 'bp_activity_delete' hook.
  * @uses do_action() To call the 'bp_activity_deleted_activities' hook.
- * @uses wp_cache_delete()
+ * @uses bp_cache_delete()
  *
  * @param array $args To delete specific activity items, use
  *            $args = array( 'id' => $ids );
@@ -2257,7 +2257,7 @@
 	 */
 	do_action( 'bp_activity_deleted_activities', $activity_ids_deleted );
 
-	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+	bp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
 
 	return true;
 }
@@ -2398,7 +2398,7 @@
 	}
 
 	// Purge comment cache for the root activity update
-	wp_cache_delete( $activity_id, 'bp_activity_comments' );
+	bp_cache_delete( $activity_id, 'bp_activity_comments' );
 
 	// Recalculate the comment tree
 	BP_Activity_Activity::rebuild_activity_comment_tree( $activity_id );
@@ -2632,10 +2632,10 @@
 	$activity->is_spam = 1;
 
 	// Clear the activity stream first page cache
-	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+	bp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
 
 	// Clear the activity comment cache for this activity item
-	wp_cache_delete( $activity->id, 'bp_activity_comments' );
+	bp_cache_delete( $activity->id, 'bp_activity_comments' );
 
 	// If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity
 	if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) {
@@ -2679,10 +2679,10 @@
 	$activity->is_spam = 0;
 
 	// Clear the activity stream first page cache
-	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+	bp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
 
 	// Clear the activity comment cache for this activity item
-	wp_cache_delete( $activity->id, 'bp_activity_comments' );
+	bp_cache_delete( $activity->id, 'bp_activity_comments' );
 
 	// If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity
 	if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) {
Index: src/bp-activity/bp-activity-loader.php
===================================================================
--- src/bp-activity/bp-activity-loader.php
+++ src/bp-activity/bp-activity-loader.php
@@ -362,6 +362,23 @@
 
 		parent::setup_actions();
 	}
+
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_activity',
+			'bp_activity_comments',
+			'activity_meta'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
Index: src/bp-blogs/bp-blogs-cache.php
===================================================================
--- src/bp-blogs/bp-blogs-cache.php
+++ src/bp-blogs/bp-blogs-cache.php
@@ -44,11 +44,11 @@
  */
 function bp_blogs_clear_blog_object_cache( $blog_id = 0, $user_id = 0 ) {
 	if ( ! empty( $user_id ) ) {
-		wp_cache_delete( 'bp_blogs_of_user_'        . $user_id, 'bp' );
-		wp_cache_delete( 'bp_total_blogs_for_user_' . $user_id, 'bp' );
+		bp_cache_delete( 'bp_blogs_of_user_'        . $user_id, 'bp' );
+		bp_cache_delete( 'bp_total_blogs_for_user_' . $user_id, 'bp' );
 	}
 
-	wp_cache_delete( 'bp_total_blogs', 'bp' );
+	bp_cache_delete( 'bp_total_blogs', 'bp' );
 }
 
 // List actions to clear object caches on
Index: src/bp-blogs/bp-blogs-functions.php
===================================================================
--- src/bp-blogs/bp-blogs-functions.php
+++ src/bp-blogs/bp-blogs-functions.php
@@ -128,7 +128,7 @@
 	foreach ( (array) $blog_ids as $blog_id ) {
 
 		// Ensure that the cache is clear after the table TRUNCATE above
-		wp_cache_delete( $blog_id, 'blog_meta' );
+		bp_cache_delete( $blog_id, 'blog_meta' );
 
 		// Get all users
 		$users = get_users( array(
@@ -1144,12 +1144,12 @@
  * @return int $count Total blog count.
  */
 function bp_blogs_total_blogs() {
-	$count = wp_cache_get( 'bp_total_blogs', 'bp' );
+	$count = bp_cache_get( 'bp_total_blogs', 'bp' );
 
 	if ( false === $count ) {
 		$blogs = BP_Blogs_Blog::get_all();
 		$count = $blogs['total'];
-		wp_cache_set( 'bp_total_blogs', $count, 'bp' );
+		bp_cache_set( 'bp_total_blogs', $count, 'bp' );
 	}
 	return $count;
 }
@@ -1173,10 +1173,10 @@
 		return 0;
 	}
 
-	$count = wp_cache_get( 'bp_total_blogs_for_user_' . $user_id, 'bp' );
+	$count = bp_cache_get( 'bp_total_blogs_for_user_' . $user_id, 'bp' );
 	if ( false === $count ) {
 		$count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );
-		wp_cache_set( 'bp_total_blogs_for_user_' . $user_id, $count, 'bp' );
+		bp_cache_set( 'bp_total_blogs_for_user_' . $user_id, $count, 'bp' );
 	}
 
 	return $count;
Index: src/bp-blogs/bp-blogs-loader.php
===================================================================
--- src/bp-blogs/bp-blogs-loader.php
+++ src/bp-blogs/bp-blogs-loader.php
@@ -272,6 +272,21 @@
 	}
 
 	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'blog_meta'
+		) );
+
+		parent::setup_cache_groups();
+	}
+
+	/**
 	 * Set up the tracking arguments for the 'post' post type.
 	 *
 	 * @since BuddyPress (2.2.0)
Index: src/bp-core/bp-core-cache.php
===================================================================
--- src/bp-core/bp-core-cache.php
+++ src/bp-core/bp-core-cache.php
@@ -203,7 +203,7 @@
 
 	foreach ( $item_ids as $item_id ) {
 		$item_id = (int) $item_id;
-		if ( false === wp_cache_get( $item_id, $cache_group ) ) {
+		if ( false === bp_cache_get( $item_id, $cache_group ) ) {
 			$uncached[] = $item_id;
 		}
 	}
@@ -302,7 +302,7 @@
 				$cache[ $uncached_id ] = array();
 			}
 
-			wp_cache_set( $uncached_id, $cache[ $uncached_id ], $cache_group );
+			bp_cache_set( $uncached_id, $cache[ $uncached_id ], $cache_group );
 		}
 	}
 
Index: src/bp-core/bp-core-classes.php
===================================================================
--- src/bp-core/bp-core-classes.php
+++ src/bp-core/bp-core-classes.php
@@ -1416,7 +1416,7 @@
 			$last_activities = $wpdb->get_results( $wpdb->prepare( "SELECT id, user_id, date_recorded FROM {$bp->members->table_name_last_activity} WHERE component = %s AND type = 'last_activity' AND user_id IN ({$user_ids_sql}) LIMIT {$user_count}", $bp->members->id ) );
 
 			foreach ( $last_activities as $last_activity ) {
-				wp_cache_set( $last_activity->user_id, array(
+				bp_cache_set( $last_activity->user_id, array(
 					'user_id'       => $last_activity->user_id,
 					'date_recorded' => $last_activity->date_recorded,
 					'activity_id'   => $last_activity->id,
@@ -1427,7 +1427,7 @@
 		// Fetch all user data from the cache
 		$retval = array();
 		foreach ( $user_ids as $user_id ) {
-			$retval[ $user_id ] = wp_cache_get( $user_id, 'bp_last_activity' );
+			$retval[ $user_id ] = bp_cache_get( $user_id, 'bp_last_activity' );
 		}
 
 		return $retval;
@@ -1520,7 +1520,7 @@
 		}
 
 		// set cache
-		wp_cache_set( $user_id, $activity[ $user_id ], 'bp_last_activity' );
+		bp_cache_set( $user_id, $activity[ $user_id ], 'bp_last_activity' );
 
 		return $updated;
 	}
@@ -1557,7 +1557,7 @@
 			)
 		);
 
-		wp_cache_delete( $user_id, 'bp_last_activity' );
+		bp_cache_delete( $user_id, 'bp_last_activity' );
 
 		return $deleted;
 	}
Index: src/bp-friends/bp-friends-cache.php
===================================================================
--- src/bp-friends/bp-friends-cache.php
+++ src/bp-friends/bp-friends-cache.php
@@ -23,8 +23,8 @@
 	if ( !$friendship = new BP_Friends_Friendship( $friendship_id ) )
 		return false;
 
-	wp_cache_delete( 'friends_friend_ids_' .    $friendship->initiator_user_id, 'bp' );
-	wp_cache_delete( 'friends_friend_ids_' .    $friendship->friend_user_id,    'bp' );
+	bp_cache_delete( 'friends_friend_ids_' .    $friendship->initiator_user_id, 'bp' );
+	bp_cache_delete( 'friends_friend_ids_' .    $friendship->friend_user_id,    'bp' );
 }
 
 // List actions to clear object caches on
@@ -39,7 +39,7 @@
  * @param int $friend_user_id The user ID not initiating the friendship
  */
 function bp_friends_clear_request_cache( $friend_user_id ) {
-	wp_cache_delete( $friend_user_id, 'bp_friends_requests' );
+	bp_cache_delete( $friend_user_id, 'bp_friends_requests' );
 }
 
 /**
Index: src/bp-friends/bp-friends-classes.php
===================================================================
--- src/bp-friends/bp-friends-classes.php
+++ src/bp-friends/bp-friends-classes.php
@@ -240,14 +240,14 @@
 	 * @return array|bool An array of user IDs, or false if none are found.
 	 */
 	public static function get_friendship_request_user_ids( $user_id ) {
-		$friend_requests = wp_cache_get( $user_id, 'bp_friends_requests' );
+		$friend_requests = bp_cache_get( $user_id, 'bp_friends_requests' );
 
 		if ( false === $friend_requests ) {
 			global $wpdb, $bp;
 
 			$friend_requests = $wpdb->get_col( $wpdb->prepare( "SELECT initiator_user_id FROM {$bp->friends->table_name} WHERE friend_user_id = %d AND is_confirmed = 0", $user_id ) );
 
-			wp_cache_set( $user_id, $friend_requests, 'bp_friends_requests' );
+			bp_cache_set( $user_id, $friend_requests, 'bp_friends_requests' );
 		}
 
 		return $friend_requests;
Index: src/bp-friends/bp-friends-loader.php
===================================================================
--- src/bp-friends/bp-friends-loader.php
+++ src/bp-friends/bp-friends-loader.php
@@ -239,6 +239,21 @@
 
 		parent::setup_title();
 	}
+
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_friend_requests'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
Index: src/bp-friends/bp-friends-template.php
===================================================================
--- src/bp-friends/bp-friends-template.php
+++ src/bp-friends/bp-friends-template.php
@@ -73,9 +73,9 @@
  */
 function bp_friends_random_friends() {
 
-	if ( !$friend_ids = wp_cache_get( 'friends_friend_ids_' . bp_displayed_user_id(), 'bp' ) ) {
+	if ( !$friend_ids = bp_cache_get( 'friends_friend_ids_' . bp_displayed_user_id(), 'bp' ) ) {
 		$friend_ids = BP_Friends_Friendship::get_random_friends( bp_displayed_user_id() );
-		wp_cache_set( 'friends_friend_ids_' . bp_displayed_user_id(), $friend_ids, 'bp' );
+		bp_cache_set( 'friends_friend_ids_' . bp_displayed_user_id(), $friend_ids, 'bp' );
 	} ?>
 
 	<div class="info-group">
@@ -121,9 +121,9 @@
  */
 function bp_friends_random_members( $total_members = 5 ) {
 
-	if ( !$user_ids = wp_cache_get( 'friends_random_users', 'bp' ) ) {
+	if ( !$user_ids = bp_cache_get( 'friends_random_users', 'bp' ) ) {
 		$user_ids = BP_Core_User::get_users( 'random', $total_members );
-		wp_cache_set( 'friends_random_users', $user_ids, 'bp' );
+		bp_cache_set( 'friends_random_users', $user_ids, 'bp' );
 	}
 
 	?>
@@ -494,9 +494,9 @@
 	function bp_get_friend_friendship_id() {
 		global $members_template;
 
-		if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) {
+		if ( !$friendship_id = bp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) {
 			$friendship_id = friends_get_friendship_id( $members_template->member->id, bp_loggedin_user_id() );
-			wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
+			bp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
 		}
 
 		/**
@@ -523,9 +523,9 @@
 	function bp_get_friend_accept_request_link() {
 		global $members_template;
 
-		if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) {
+		if ( !$friendship_id = bp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) {
 			$friendship_id = friends_get_friendship_id( $members_template->member->id, bp_loggedin_user_id() );
-			wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
+			bp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
 		}
 
 		/**
@@ -552,9 +552,9 @@
 	function bp_get_friend_reject_request_link() {
 		global $members_template;
 
-		if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) {
+		if ( !$friendship_id = bp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) {
 			$friendship_id = friends_get_friendship_id( $members_template->member->id, bp_loggedin_user_id() );
-			wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
+			bp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
 		}
 
 		/**
Index: src/bp-groups/bp-groups-activity.php
===================================================================
--- src/bp-groups/bp-groups-activity.php
+++ src/bp-groups/bp-groups-activity.php
@@ -213,7 +213,7 @@
 		// rather than manually
 		$uncached_ids = array();
 		foreach ( $group_ids as $group_id ) {
-			if ( false === wp_cache_get( $group_id, 'bp_groups' ) ) {
+			if ( false === bp_cache_get( $group_id, 'bp_groups' ) ) {
 				$uncached_ids[] = $group_id;
 			}
 		}
@@ -224,7 +224,7 @@
 			$uncached_ids_sql = implode( ',', wp_parse_id_list( $uncached_ids ) );
 			$groups = $wpdb->get_results( "SELECT * FROM {$bp->groups->table_name} WHERE id IN ({$uncached_ids_sql})" );
 			foreach ( $groups as $group ) {
-				wp_cache_set( $group->id, $group, 'bp_groups' );
+				bp_cache_set( $group->id, $group, 'bp_groups' );
 			}
 		}
 	}
Index: src/bp-groups/bp-groups-cache.php
===================================================================
--- src/bp-groups/bp-groups-cache.php
+++ src/bp-groups/bp-groups-cache.php
@@ -48,7 +48,7 @@
  * @param $group_id Not used.
  */
 function groups_clear_group_object_cache( $group_id ) {
-	wp_cache_delete( 'bp_total_group_count', 'bp' );
+	bp_cache_delete( 'bp_total_group_count', 'bp' );
 }
 add_action( 'groups_group_deleted',              'groups_clear_group_object_cache' );
 add_action( 'groups_settings_updated',           'groups_clear_group_object_cache' );
@@ -64,7 +64,7 @@
  * @param int $group_id The group being edited.
  */
 function bp_groups_delete_group_cache( $group_id = 0 ) {
-	wp_cache_delete( $group_id, 'bp_groups' );
+	bp_cache_delete( $group_id, 'bp_groups' );
 }
 add_action( 'groups_delete_group',     'bp_groups_delete_group_cache' );
 add_action( 'groups_update_group',     'bp_groups_delete_group_cache' );
@@ -77,7 +77,7 @@
  * @since BuddyPress (2.0.0)
  */
 function bp_groups_delete_group_cache_on_metadata_change( $meta_id, $group_id ) {
-	wp_cache_delete( $group_id, 'bp_groups' );
+	bp_cache_delete( $group_id, 'bp_groups' );
 }
 add_action( 'updated_group_meta', 'bp_groups_delete_group_cache_on_metadata_change', 10, 2 );
 add_action( 'added_group_meta', 'bp_groups_delete_group_cache_on_metadata_change', 10, 2 );
@@ -121,7 +121,7 @@
  * @param int $user_id The user ID.
  */
 function bp_groups_clear_invite_count_for_user( $user_id ) {
-	wp_cache_delete( $user_id, 'bp_group_invite_count' );
+	bp_cache_delete( $user_id, 'bp_group_invite_count' );
 }
 add_action( 'groups_accept_invite', 'bp_groups_clear_invite_count_for_user' );
 add_action( 'groups_reject_invite', 'bp_groups_clear_invite_count_for_user' );
@@ -164,7 +164,7 @@
  * @param int $user_id The user ID.
  */
 function groups_clear_group_user_object_cache( $group_id, $user_id ) {
-	wp_cache_delete( 'bp_total_groups_for_user_' . $user_id, 'bp' );
+	bp_cache_delete( 'bp_total_groups_for_user_' . $user_id, 'bp' );
 }
 add_action( 'groups_join_group',    'groups_clear_group_user_object_cache', 10, 2 );
 add_action( 'groups_leave_group',   'groups_clear_group_user_object_cache', 10, 2 );
@@ -181,7 +181,7 @@
  * @param int $group_id The group ID.
  */
 function groups_clear_group_administrator_cache( $group_id ) {
-	wp_cache_delete( $group_id, 'bp_group_admins' );
+	bp_cache_delete( $group_id, 'bp_group_admins' );
 }
 add_action( 'groups_promote_member', 'groups_clear_group_administrator_cache' );
 add_action( 'groups_demote_member',  'groups_clear_group_administrator_cache' );
Index: src/bp-groups/bp-groups-classes.php
===================================================================
--- src/bp-groups/bp-groups-classes.php
+++ src/bp-groups/bp-groups-classes.php
@@ -186,13 +186,13 @@
 		$bp    = buddypress();
 
 		// Check cache for group data
-		$group = wp_cache_get( $this->id, 'bp_groups' );
+		$group = bp_cache_get( $this->id, 'bp_groups' );
 
 		// Cache missed, so query the DB
 		if ( false === $group ) {
 			$group = $wpdb->get_row( $wpdb->prepare( "SELECT g.* FROM {$bp->groups->table_name} g WHERE g.id = %d", $this->id ) );
 
-			wp_cache_set( $this->id, $group, 'bp_groups' );
+			bp_cache_set( $this->id, $group, 'bp_groups' );
 		}
 
 		// No group found so set the ID and bail
@@ -344,7 +344,7 @@
 
 		do_action_ref_array( 'groups_group_after_save', array( &$this ) );
 
-		wp_cache_delete( $this->id, 'bp_groups' );
+		bp_cache_delete( $this->id, 'bp_groups' );
 
 		return true;
 	}
@@ -372,7 +372,7 @@
 
 		do_action_ref_array( 'bp_groups_delete_group', array( &$this, $user_ids ) );
 
-		wp_cache_delete( $this->id, 'bp_groups' );
+		bp_cache_delete( $this->id, 'bp_groups' );
 
 		// Finally remove the group entry from the DB
 		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name} WHERE id = %d", $this->id ) ) )
@@ -2422,11 +2422,11 @@
 
 		$bp = buddypress();
 
-		$count = wp_cache_get( $user_id, 'bp_group_invite_count' );
+		$count = bp_cache_get( $user_id, 'bp_group_invite_count' );
 
 		if ( false === $count ) {
 			$count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND m.is_confirmed = 0 AND m.inviter_id != 0 AND m.invite_sent = 1 AND m.user_id = %d", $user_id ) );
-			wp_cache_set( $user_id, $count, 'bp_group_invite_count' );
+			bp_cache_set( $user_id, $count, 'bp_group_invite_count' );
 		}
 
 		return $count;
@@ -2630,12 +2630,12 @@
 	public static function get_group_administrator_ids( $group_id ) {
 		global $bp, $wpdb;
 
-		$group_admins = wp_cache_get( $group_id, 'bp_group_admins' );
+		$group_admins = bp_cache_get( $group_id, 'bp_group_admins' );
 
 		if ( false === $group_admins ) {
 			$group_admins = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_admin = 1 AND is_banned = 0", $group_id ) );
 
-			wp_cache_set( $group_id, $group_admins, 'bp_group_admins' );
+			bp_cache_set( $group_id, $group_admins, 'bp_group_admins' );
 		}
 
 		return $group_admins;
Index: src/bp-groups/bp-groups-functions.php
===================================================================
--- src/bp-groups/bp-groups-functions.php
+++ src/bp-groups/bp-groups-functions.php
@@ -644,11 +644,11 @@
  * @return int
  */
 function groups_get_total_group_count() {
-	$count = wp_cache_get( 'bp_total_group_count', 'bp' );
+	$count = bp_cache_get( 'bp_total_group_count', 'bp' );
 
 	if ( false === $count ) {
 		$count = BP_Groups_Group::get_total_group_count();
-		wp_cache_set( 'bp_total_group_count', $count, 'bp' );
+		bp_cache_set( 'bp_total_group_count', $count, 'bp' );
 	}
 
 	return $count;
@@ -686,11 +686,11 @@
 	if ( empty( $user_id ) )
 		$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
 
-	$count = wp_cache_get( 'bp_total_groups_for_user_' . $user_id, 'bp' );
+	$count = bp_cache_get( 'bp_total_groups_for_user_' . $user_id, 'bp' );
 
 	if ( false === $count ) {
 		$count = BP_Groups_Member::total_group_count( $user_id );
-		wp_cache_set( 'bp_total_groups_for_user_' . $user_id, $count, 'bp' );
+		bp_cache_set( 'bp_total_groups_for_user_' . $user_id, $count, 'bp' );
 	}
 
 	return $count;
Index: src/bp-groups/bp-groups-loader.php
===================================================================
--- src/bp-groups/bp-groups-loader.php
+++ src/bp-groups/bp-groups-loader.php
@@ -676,6 +676,23 @@
 
 		parent::setup_title();
 	}
+
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_groups',
+			'bp_group_admins',
+			'bp_group_invite_count'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
Index: src/bp-members/bp-members-cache.php
===================================================================
--- src/bp-members/bp-members-cache.php
+++ src/bp-members/bp-members-cache.php
@@ -22,13 +22,13 @@
 
 	$cached_member_ids = array();
 	foreach ( $member_types as $member_type ) {
-		wp_cache_set( $member_type->object_id, $member_type->name, 'bp_member_type' );
+		bp_cache_set( $member_type->object_id, $member_type->name, 'bp_member_type' );
 		$cached_member_ids[] = $member_type->object_id;
 	}
 
 	// Cache an empty value for users with no type.
 	foreach ( array_diff( $uncached_member_ids, $cached_member_ids ) as $no_type_id ) {
-		wp_cache_set( $no_type_id, '', 'bp_member_type' );
+		bp_cache_set( $no_type_id, '', 'bp_member_type' );
 	}
 }
 add_action( 'bp_user_query_populate_extras', 'bp_members_prefetch_member_type' );
@@ -43,7 +43,7 @@
  * @param int $user_id ID of the deleted user.
  */
 function bp_members_clear_member_type_cache( $user_id ) {
-	wp_cache_delete( $user_id, 'bp_member_type' );
+	bp_cache_delete( $user_id, 'bp_member_type' );
 }
 add_action( 'wpmu_delete_user', 'bp_members_clear_member_type_cache' );
 add_action( 'delete_user', 'bp_members_clear_member_type_cache' );
Index: src/bp-members/bp-members-functions.php
===================================================================
--- src/bp-members/bp-members-functions.php
+++ src/bp-members/bp-members-functions.php
@@ -200,9 +200,9 @@
 		return false;
 	}
 
-	if ( !$userdata = wp_cache_get( 'bp_core_userdata_' . $user_id, 'bp' ) ) {
+	if ( !$userdata = bp_cache_get( 'bp_core_userdata_' . $user_id, 'bp' ) ) {
 		$userdata = BP_Core_User::get_core_userdata( $user_id );
-		wp_cache_set( 'bp_core_userdata_' . $user_id, $userdata, 'bp' );
+		bp_cache_set( 'bp_core_userdata_' . $user_id, $userdata, 'bp' );
 	}
 
 	/**
@@ -296,7 +296,7 @@
 	$bp = buddypress();
 
 	// Check cache for user nicename
-	$username = wp_cache_get( 'bp_user_username_' . $user_id, 'bp' );
+	$username = bp_cache_get( 'bp_user_username_' . $user_id, 'bp' );
 	if ( false === $username ) {
 
 		// Cache not found so prepare to update it
@@ -345,11 +345,11 @@
 
 	// Add this to cache
 	if ( ( true === $update_cache ) && !empty( $username ) ) {
-		wp_cache_set( 'bp_user_username_' . $user_id, $username, 'bp' );
+		bp_cache_set( 'bp_user_username_' . $user_id, $username, 'bp' );
 
 	// @todo bust this cache if no $username found?
 	//} else {
-	//	wp_cache_delete( 'bp_user_username_' . $user_id );
+	//	bp_cache_delete( 'bp_user_username_' . $user_id );
 	}
 
 	/**
@@ -378,7 +378,7 @@
 function bp_members_get_user_nicename( $user_id ) {
 	$bp = buddypress();
 
-	if ( !$user_nicename = wp_cache_get( 'bp_members_user_nicename_' . $user_id, 'bp' ) ) {
+	if ( !$user_nicename = bp_cache_get( 'bp_members_user_nicename_' . $user_id, 'bp' ) ) {
 		$update_cache = true;
 
 		// User ID matches logged in user
@@ -413,7 +413,7 @@
 
 	// Add this to cache
 	if ( true == $update_cache && !empty( $user_nicename ) ) {
-		wp_cache_set( 'bp_members_user_nicename_' . $user_id, $user_nicename, 'bp' );
+		bp_cache_set( 'bp_members_user_nicename_' . $user_id, $user_nicename, 'bp' );
 	}
 
 	/**
@@ -435,7 +435,7 @@
  */
 function bp_core_get_user_email( $uid ) {
 
-	if ( !$email = wp_cache_get( 'bp_user_email_' . $uid, 'bp' ) ) {
+	if ( !$email = bp_cache_get( 'bp_user_email_' . $uid, 'bp' ) ) {
 
 		// User exists
 		$ud = bp_core_get_core_userdata( $uid );
@@ -447,7 +447,7 @@
 			$email = '';
 		}
 
-		wp_cache_set( 'bp_user_email_' . $uid, $email, 'bp' );
+		bp_cache_set( 'bp_user_email_' . $uid, $email, 'bp' );
 	}
 
 	/**
@@ -529,7 +529,7 @@
 
 	$uncached_ids = array();
 	foreach ( $user_ids as $user_id ) {
-		if ( false === wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) {
+		if ( false === bp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) {
 			$uncached_ids[] = $user_id;
 		}
 	}
@@ -576,13 +576,13 @@
 		}
 
 		foreach ( $fullnames as $fuser_id => $fname ) {
-			wp_cache_set( 'bp_user_fullname_' . $fuser_id, $fname, 'bp' );
+			bp_cache_set( 'bp_user_fullname_' . $fuser_id, $fname, 'bp' );
 		}
 	}
 
 	$retval = array();
 	foreach ( $user_ids as $user_id ) {
-		$retval[ $user_id ] = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' );
+		$retval[ $user_id ] = bp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' );
 	}
 
 	return $retval;
@@ -691,12 +691,12 @@
 function bp_core_get_total_member_count() {
 	global $wpdb;
 
-	$count = wp_cache_get( 'bp_total_member_count', 'bp' );
+	$count = bp_cache_get( 'bp_total_member_count', 'bp' );
 
 	if ( false === $count ) {
 		$status_sql = bp_core_get_status_sql();
 		$count = $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->users} WHERE {$status_sql}" );
-		wp_cache_set( 'bp_total_member_count', $count, 'bp' );
+		bp_cache_set( 'bp_total_member_count', $count, 'bp' );
 	}
 
 	/**
@@ -2592,7 +2592,7 @@
 
 	// Bust the cache if the type has been updated.
 	if ( ! is_wp_error( $retval ) ) {
-		wp_cache_delete( $user_id, 'bp_member_type' );
+		bp_cache_delete( $user_id, 'bp_member_type' );
 
 		/**
 		 * Fires just after a user's member type has been changed.
@@ -2621,14 +2621,14 @@
  *                           types (if $single is false). Returns false on failure.
  */
 function bp_get_member_type( $user_id, $single = true ) {
-	$types = wp_cache_get( $user_id, 'bp_member_type' );
+	$types = bp_cache_get( $user_id, 'bp_member_type' );
 
 	if ( false === $types ) {
 		$types = bp_get_object_terms( $user_id, 'bp_member_type'  );
 
 		if ( ! is_wp_error( $types ) ) {
 			$types = wp_list_pluck( $types, 'name' );
-			wp_cache_set( $user_id, $types, 'bp_member_type' );
+			bp_cache_set( $user_id, $types, 'bp_member_type' );
 		}
 	}
 
Index: src/bp-members/bp-members-loader.php
===================================================================
--- src/bp-members/bp-members-loader.php
+++ src/bp-members/bp-members-loader.php
@@ -276,6 +276,21 @@
 
 		parent::setup_title();
 	}
+
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_member_type'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
Index: src/bp-messages/bp-messages-cache.php
===================================================================
--- src/bp-messages/bp-messages-cache.php
+++ src/bp-messages/bp-messages-cache.php
@@ -54,7 +54,7 @@
  */
 function bp_messages_clear_unread_count_cache_on_message_save( BP_Messages_Message $message ) {
 	foreach ( (array) $message->recipients as $recipient ) {
-		wp_cache_delete( $recipient->user_id, 'bp_messages_unread_count' );
+		bp_cache_delete( $recipient->user_id, 'bp_messages_unread_count' );
 	}
 }
 add_action( 'messages_message_after_save', 'bp_messages_clear_unread_count_cache_on_message_save' );
@@ -68,7 +68,7 @@
  *  array of thread IDs
  */
 function bp_messages_clear_unread_count_cache_on_message_delete( $thread_ids ) {
-	wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
+	bp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
 }
 add_action( 'messages_before_delete_thread', 'bp_messages_clear_unread_count_cache_on_message_delete' );
 
@@ -80,7 +80,7 @@
  * @since BuddyPress (2.0.0)
  */
 function bp_notices_clear_cache( $notice ) {
-	wp_cache_delete( 'active_notice', 'bp_messages' );
+	bp_cache_delete( 'active_notice', 'bp_messages' );
 }
 add_action( 'messages_notice_after_save',    'bp_notices_clear_cache' );
 add_action( 'messages_notice_before_delete', 'bp_notices_clear_cache' );
Index: src/bp-messages/bp-messages-classes.php
===================================================================
--- src/bp-messages/bp-messages-classes.php
+++ src/bp-messages/bp-messages-classes.php
@@ -434,7 +434,7 @@
 		$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 0 WHERE user_id = %d AND thread_id = %d", bp_loggedin_user_id(), $thread_id );
 		$wpdb->query($sql);
 
-		wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
+		bp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
 	}
 
 	/**
@@ -450,7 +450,7 @@
 		$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 1 WHERE user_id = %d AND thread_id = %d", bp_loggedin_user_id(), $thread_id );
 		$wpdb->query($sql);
 
-		wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
+		bp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
 	}
 
 	/**
@@ -533,12 +533,12 @@
 			$user_id = bp_loggedin_user_id();
 		}
 
-		$unread_count = wp_cache_get( $user_id, 'bp_messages_unread_count' );
+		$unread_count = bp_cache_get( $user_id, 'bp_messages_unread_count' );
 
 		if ( false === $unread_count ) {
 			$unread_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM(unread_count) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0 AND sender_only = 0", $user_id ) );
 
-			wp_cache_set( $user_id, $unread_count, 'bp_messages_unread_count' );
+			bp_cache_set( $user_id, $unread_count, 'bp_messages_unread_count' );
 		}
 
 		/**
@@ -1132,7 +1132,7 @@
 	 * @return object The BP_Messages_Notice object
 	 */
 	public static function get_active() {
-		$notice = wp_cache_get( 'active_notice', 'bp_messages' );
+		$notice = bp_cache_get( 'active_notice', 'bp_messages' );
 
 		if ( false === $notice ) {
 			global $wpdb, $bp;
@@ -1140,7 +1140,7 @@
 			$notice_id = $wpdb->get_var( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" );
 			$notice    = new BP_Messages_Notice( $notice_id );
 
-			wp_cache_set( 'active_notice', $notice, 'bp_messages' );
+			bp_cache_set( 'active_notice', $notice, 'bp_messages' );
 		}
 
 		return $notice;
Index: src/bp-messages/bp-messages-loader.php
===================================================================
--- src/bp-messages/bp-messages-loader.php
+++ src/bp-messages/bp-messages-loader.php
@@ -292,6 +292,23 @@
 
 		parent::setup_title();
 	}
+
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_messages',
+			'bp_messages_unread_count',
+			'message_meta'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
Index: src/bp-notifications/bp-notifications-cache.php
===================================================================
--- src/bp-notifications/bp-notifications-cache.php
+++ src/bp-notifications/bp-notifications-cache.php
@@ -14,7 +14,7 @@
  * @param BP_Notification_Notification $n Notification object.
  */
 function bp_notifications_clear_all_for_user_cache_after_save( BP_Notifications_Notification $n ) {
-	wp_cache_delete( 'all_for_user_' . $n->user_id, 'bp_notifications' );
+	bp_cache_delete( 'all_for_user_' . $n->user_id, 'bp_notifications' );
 }
 add_action( 'bp_notification_after_save', 'bp_notifications_clear_all_for_user_cache_after_save' );
 
@@ -35,7 +35,7 @@
 	}
 
 	foreach ( array_unique( $user_ids ) as $user_id ) {
-		wp_cache_delete( 'all_for_user_' . $user_id, 'bp_notifications' );
+		bp_cache_delete( 'all_for_user_' . $user_id, 'bp_notifications' );
 	}
 }
 add_action( 'bp_notification_before_delete', 'bp_notifications_clear_all_for_user_cache_before_delete' );
Index: src/bp-notifications/bp-notifications-classes.php
===================================================================
--- src/bp-notifications/bp-notifications-classes.php
+++ src/bp-notifications/bp-notifications-classes.php
@@ -681,7 +681,7 @@
 
 		// make sure we delete the notification cache for the user on update
 		if ( ! empty( $where_args['user_id'] ) ) {
-			wp_cache_delete( 'all_for_user_' . $where_args['user_id'], 'bp_notifications' );
+			bp_cache_delete( 'all_for_user_' . $where_args['user_id'], 'bp_notifications' );
 		}
 
 		return self::_update( $update['data'], $where['data'], $update['format'], $where['format'] );
Index: src/bp-notifications/bp-notifications-functions.php
===================================================================
--- src/bp-notifications/bp-notifications-functions.php
+++ src/bp-notifications/bp-notifications-functions.php
@@ -143,12 +143,12 @@
 	}
 
 	// Get notifications out of the cache, or query if necessary
-	$notifications = wp_cache_get( 'all_for_user_' . $user_id, 'bp_notifications' );
+	$notifications = bp_cache_get( 'all_for_user_' . $user_id, 'bp_notifications' );
 	if ( false === $notifications ) {
 		$notifications = BP_Notifications_Notification::get( array(
 			'user_id' => $user_id
 		) );
-		wp_cache_set( 'all_for_user_' . $user_id, $notifications, 'bp_notifications' );
+		bp_cache_set( 'all_for_user_' . $user_id, $notifications, 'bp_notifications' );
 	}
 
 	// Filter and return
Index: src/bp-notifications/bp-notifications-loader.php
===================================================================
--- src/bp-notifications/bp-notifications-loader.php
+++ src/bp-notifications/bp-notifications-loader.php
@@ -237,6 +237,21 @@
 
 		parent::setup_title();
 	}
+
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_notifications'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
Index: src/bp-xprofile/bp-xprofile-cache.php
===================================================================
--- src/bp-xprofile/bp-xprofile-cache.php
+++ src/bp-xprofile/bp-xprofile-cache.php
@@ -13,6 +13,29 @@
 if ( !defined( 'ABSPATH' ) ) exit;
 
 /**
+ * Determine which xprofile fields do not have cached values for a user.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param int   $user_id   User ID to check
+ * @param array $field_ids XProfile field IDs.
+ * @return array
+ */
+function bp_xprofile_get_non_cached_field_ids( $user_id = 0, $field_ids = array() ) {
+	$uncached_fields = array();
+
+	foreach ( $field_ids as $field_id ) {
+		$field_id   = (int) $field_id;
+		$cache_key = "{$user_id}:{$field_id}";
+		if ( false === bp_cache_get( $cache_key, 'bp_xprofile_data' ) ) {
+			$uncached_fields[] = $field_id;
+		}
+	}
+
+	return $uncached_fields;
+}
+
+/**
  * Slurp up xprofilemeta for a specified set of profile objects.
  *
  * We do not use bp_update_meta_cache() for the xprofile component. This is
@@ -112,7 +135,7 @@
 		foreach ( $cache as $object_type => $object_caches ) {
 			$cache_group = $cache_groups[ $object_type ];
 			foreach ( $object_caches as $object_id => $object_cache ) {
-				wp_cache_set( $object_id, $object_cache, $cache_group );
+				bp_cache_set( $object_id, $object_cache, $cache_group );
 			}
 		}
 	}
@@ -121,14 +144,14 @@
 }
 
 function xprofile_clear_profile_groups_object_cache( $group_obj ) {
-	wp_cache_delete( 'xprofile_groups_inc_empty',        'bp' );
-	wp_cache_delete( 'xprofile_group_' . $group_obj->id, 'bp' );
+	bp_cache_delete( 'xprofile_groups_inc_empty',        'bp' );
+	bp_cache_delete( 'xprofile_group_' . $group_obj->id, 'bp' );
 }
 add_action( 'xprofile_group_after_delete', 'xprofile_clear_profile_groups_object_cache' );
 add_action( 'xprofile_group_after_save',   'xprofile_clear_profile_groups_object_cache' );
 
 function xprofile_clear_profile_data_object_cache( $group_id ) {
-	wp_cache_delete( 'bp_user_fullname_' . bp_loggedin_user_id(), 'bp' );
+	bp_cache_delete( 'bp_user_fullname_' . bp_loggedin_user_id(), 'bp' );
 }
 add_action( 'xprofile_updated_profile', 'xprofile_clear_profile_data_object_cache'   );
 
@@ -142,7 +165,7 @@
  */
 function xprofile_clear_fullname_cache_on_profile_field_edit( $data ) {
 	if ( 1 == $data->field_id ) {
-		wp_cache_delete( 'bp_user_fullname_' . $data->user_id, 'bp' );
+		bp_cache_delete( 'bp_user_fullname_' . $data->user_id, 'bp' );
 	}
 }
 add_action( 'xprofile_data_after_save', 'xprofile_clear_fullname_cache_on_profile_field_edit' );
@@ -156,13 +179,13 @@
  */
 function xprofile_clear_profile_field_object_cache( $field_obj ) {
 	// Clear default visibility level cache
-	wp_cache_delete( 'xprofile_default_visibility_levels', 'bp' );
+	bp_cache_delete( 'xprofile_default_visibility_levels', 'bp' );
 
 	// Modified fields can alter parent group status, in particular when
 	// the group goes from empty to non-empty. Bust its cache, as well as
 	// the global group_inc_empty cache
-	wp_cache_delete( 'xprofile_group_' . $field_obj->group_id, 'bp' );
-	wp_cache_delete( 'xprofile_groups_inc_empty', 'bp' );
+	bp_cache_delete( 'xprofile_group_' . $field_obj->group_id, 'bp' );
+	bp_cache_delete( 'xprofile_groups_inc_empty', 'bp' );
 }
 add_action( 'xprofile_fields_saved_field', 'xprofile_clear_profile_field_object_cache' );
 add_action( 'xprofile_fields_deleted_field', 'xprofile_clear_profile_field_object_cache' );
@@ -175,7 +198,7 @@
  * @param BP_XProfile_ProfileData $data_obj
  */
 function xprofile_clear_profiledata_object_cache( $data_obj ) {
-	wp_cache_delete( $data_obj->field_id, 'bp_xprofile_data_' . $data_obj->user_id );
+	bp_cache_delete( "{$data_obj->user_id}:{$data_obj->field_id}", 'bp_xprofile_data' );
 }
 add_action( 'xprofile_data_after_save', 'xprofile_clear_profiledata_object_cache' );
 add_action( 'xprofile_data_after_delete', 'xprofile_clear_profiledata_object_cache' );
@@ -196,7 +219,7 @@
  * @since BuddyPress (2.0.0)
  */
 function xprofile_clear_fullname_field_id_cache() {
-	wp_cache_delete( 'fullname_field_id', 'bp_xprofile' );
+	bp_cache_delete( 'fullname_field_id', 'bp_xprofile' );
 }
 add_action( 'update_option_bp-xprofile-fullname-field-name', 'xprofile_clear_fullname_field_id_cache' );
 
Index: src/bp-xprofile/bp-xprofile-classes.php
===================================================================
--- src/bp-xprofile/bp-xprofile-classes.php
+++ src/bp-xprofile/bp-xprofile-classes.php
@@ -26,7 +26,7 @@
 	public function populate( $id ) {
 		global $wpdb, $bp;
 
-		$group = wp_cache_get( 'xprofile_group_' . $this->id, 'bp' );
+		$group = bp_cache_get( 'xprofile_group_' . $this->id, 'bp' );
 
 		if ( false === $group ) {
 			$group = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_groups} WHERE id = %d", $id ) );
@@ -367,7 +367,7 @@
 		foreach ( $group_ids as $group_id ) {
 
 			// If cached data is found, use it
-			if ( $group_data = wp_cache_get( 'xprofile_group_' . $group_id, 'bp' ) ) {
+			if ( $group_data = bp_cache_get( 'xprofile_group_' . $group_id, 'bp' ) ) {
 				$groups[ $group_id ] = $group_data;
 
 			// Otherwise leave a placeholder so we don't lose the order
@@ -392,7 +392,7 @@
 			// and add it to the cache
 			foreach ( (array) $queried_gdata as $gdata ) {
 				$groups[ $gdata->id ] = $gdata;
-				wp_cache_set( 'xprofile_group_' . $gdata->id, $gdata, 'bp' );
+				bp_cache_set( 'xprofile_group_' . $gdata->id, $gdata, 'bp' );
 			}
 		}
 
@@ -422,7 +422,7 @@
 		}
 
 		// purge profile field group cache
-		wp_cache_delete( 'xprofile_groups_inc_empty', 'bp' );
+		bp_cache_delete( 'xprofile_groups_inc_empty', 'bp' );
 
 		return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET group_order = %d WHERE id = %d", $position, $field_group_id ) );
 	}
@@ -482,7 +482,7 @@
 	public static function fetch_default_visibility_levels() {
 		global $wpdb, $bp;
 
-		$default_visibility_levels = wp_cache_get( 'xprofile_default_visibility_levels', 'bp' );
+		$default_visibility_levels = bp_cache_get( 'xprofile_default_visibility_levels', 'bp' );
 
 		if ( false === $default_visibility_levels ) {
 			$levels = $wpdb->get_results( "SELECT object_id, meta_key, meta_value FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND ( meta_key = 'default_visibility' OR meta_key = 'allow_custom_visibility' )" );
@@ -497,7 +497,7 @@
 				}
 			}
 
-			wp_cache_set( 'xprofile_default_visibility_levels', $default_visibility_levels, 'bp' );
+			bp_cache_set( 'xprofile_default_visibility_levels', $default_visibility_levels, 'bp' );
 		}
 
 		return $default_visibility_levels;
@@ -1222,15 +1222,15 @@
 	public function populate( $field_id, $user_id )  {
 		global $wpdb, $bp;
 
-		$cache_group = 'bp_xprofile_data_' . $user_id;
-		$profiledata = wp_cache_get( $field_id, $cache_group );
+		$cache_key   = "{$user_id}:{$field_id}";
+		$profiledata = bp_cache_get( $cache_key, 'bp_xprofile_data' );
 
 		if ( false === $profiledata ) {
-			$sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id );
+			$sql         = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id );
 			$profiledata = $wpdb->get_row( $sql );
 
 			if ( $profiledata ) {
-				wp_cache_set( $field_id, $profiledata, $cache_group );
+				bp_cache_set( $cache_key, $profiledata, 'bp_xprofile_data' );
 			}
 		}
 
@@ -1259,7 +1259,8 @@
 		global $wpdb, $bp;
 
 		// Check cache first
-		$cached = wp_cache_get( $this->field_id, 'bp_xprofile_data_' . $this->user_id );
+		$cache_key = "{$this->user_id}:{$this->field_id}";
+		$cached    = bp_cache_get( $cache_key, 'bp_xprofile_data' );
 
 		if ( $cached && ! empty( $cached->id ) ) {
 			$retval = true;
@@ -1400,9 +1401,7 @@
 
 		$data = array();
 
-		$cache_group = 'bp_xprofile_data_' . $user_id;
-
-		$uncached_field_ids = bp_get_non_cached_ids( $field_ids, $cache_group );
+		$uncached_field_ids = bp_xprofile_get_non_cached_field_ids( $user_id, $field_ids, 'bp_xprofile_data' );
 
 		// Prime the cache
 		if ( ! empty( $uncached_field_ids ) ) {
@@ -1426,9 +1425,11 @@
 			// Set caches
 			foreach ( $uncached_field_ids as $field_id ) {
 
+				$cache_key = "{$user_id}:{$field_id}";
+
 				// If a value was found, cache it
 				if ( isset( $queried_data[ $field_id ] ) ) {
-					wp_cache_set( $field_id, $queried_data[ $field_id ], $cache_group );
+					bp_cache_set( $cache_key, $queried_data[ $field_id ], 'bp_xprofile_data' );
 
 				// If no value was found, cache an empty item
 				// to avoid future cache misses
@@ -1440,14 +1441,15 @@
 					$d->value        = '';
 					$d->last_updated = '';
 
-					wp_cache_set( $field_id, $d, $cache_group );
+					bp_cache_set( $cache_key, $d, 'bp_xprofile_data' );
 				}
 			}
 		}
 
 		// Now that all items are cached, fetch them
 		foreach ( $field_ids as $field_id ) {
-			$data[] = wp_cache_get( $field_id, $cache_group );
+			$cache_key = "{$user_id}:{$field_id}";
+			$data[]    = bp_cache_get( $cache_key, 'bp_xprofile_data' );
 		}
 
 		return $data;
@@ -1460,7 +1462,6 @@
 	 * @return array
 	 */
 	public static function get_all_for_user( $user_id ) {
-		global $wpdb, $bp;
 
 		$groups = bp_xprofile_get_groups( array(
 			'user_id'                => $user_id,
@@ -1514,7 +1515,8 @@
 		} else {
 
 			// Check cache first
-			$fielddata = wp_cache_get( $field_id, 'bp_xprofile_data_' . $user_id );
+			$cache_key = "{$user_id}:{$field_id}";
+			$fielddata = bp_cache_get( $cache_key, 'bp_xprofile_data' );
 			if ( false === $fielddata || empty( $fielddata->id ) ) {
 				$fielddata_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id ) );
 			} else {
@@ -1551,7 +1553,8 @@
 		// Assemble uncached IDs
 		$uncached_ids = array();
 		foreach ( $user_ids as $user_id ) {
-			if ( false === wp_cache_get( $field_id, 'bp_xprofile_data_' . $user_id ) ) {
+			$cache_key = "{$user_id}:{$field_id}";
+			if ( false === bp_cache_get( $cache_key, 'bp_xprofile_data' ) ) {
 				$uncached_ids[] = $user_id;
 			}
 		}
@@ -1583,14 +1586,16 @@
 					$d->last_updated = '';
 				}
 
-				wp_cache_set( $field_id, $d, 'bp_xprofile_data_' . $d->user_id );
+				$cache_key = "{$d->user_id}:{$field_id}";
+				bp_cache_set( $cache_key, $d, 'bp_xprofile_data' );
 			}
 		}
 
 		// Now that the cache is primed with all data, fetch it
 		$data = array();
 		foreach ( $user_ids as $user_id ) {
-			$data[] = wp_cache_get( $field_id, 'bp_xprofile_data_' . $user_id );
+			$cache_key = "{$user_id}:{$field_id}";
+			$data[]    = bp_cache_get( $cache_key, 'bp_xprofile_data' );
 		}
 
 		// If a single ID was passed, just return the value
Index: src/bp-xprofile/bp-xprofile-functions.php
===================================================================
--- src/bp-xprofile/bp-xprofile-functions.php
+++ src/bp-xprofile/bp-xprofile-functions.php
@@ -981,7 +981,7 @@
  * @return int Field ID.
  */
 function bp_xprofile_fullname_field_id() {
-	$id = wp_cache_get( 'fullname_field_id', 'bp_xprofile' );
+	$id = bp_cache_get( 'fullname_field_id', 'bp_xprofile' );
 
 	if ( false === $id ) {
 		global $wpdb;
@@ -989,7 +989,7 @@
 		$bp = buddypress();
 		$id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", bp_xprofile_fullname_field_name() ) );
 
-		wp_cache_set( 'fullname_field_id', $id, 'bp_xprofile' );
+		bp_cache_set( 'fullname_field_id', $id, 'bp_xprofile' );
 	}
 
 	return absint( $id );
Index: src/bp-xprofile/bp-xprofile-loader.php
===================================================================
--- src/bp-xprofile/bp-xprofile-loader.php
+++ src/bp-xprofile/bp-xprofile-loader.php
@@ -353,6 +353,23 @@
 	}
 
 	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_xprofile',
+			'bp_xprofile_data',
+			'xprofile_meta'
+		) );
+
+		parent::setup_cache_groups();
+	}
+
+	/**
 	 * Adds "Settings > Profile" subnav item under the "Settings" adminbar menu.
 	 *
 	 * @since BuddyPress (2.0.0)
Index: src/bp-xprofile/bp-xprofile-template.php
===================================================================
--- src/bp-xprofile/bp-xprofile-template.php
+++ src/bp-xprofile/bp-xprofile-template.php
@@ -801,11 +801,11 @@
  * @return object $groups
  */
 function bp_profile_get_field_groups() {
-	$groups = wp_cache_get( 'xprofile_groups_inc_empty', 'bp' );
+	$groups = bp_cache_get( 'xprofile_groups_inc_empty', 'bp' );
 
 	if ( empty( $groups ) ) {
 		$groups = bp_xprofile_get_groups( array( 'fetch_fields' => true ) );
-		wp_cache_set( 'xprofile_groups_inc_empty', $groups, 'bp' );
+		bp_cache_set( 'xprofile_groups_inc_empty', $groups, 'bp' );
 	}
 
 	/**
@@ -899,9 +899,9 @@
 		if ( !is_numeric( $group_id ) )
 			$group_id = 1;
 
-		if ( !$group = wp_cache_get( 'xprofile_group_' . $group_id, 'bp' ) ) {
+		if ( !$group = bp_cache_get( 'xprofile_group_' . $group_id, 'bp' ) ) {
 			$group = new BP_XProfile_Group($group_id);
-			wp_cache_set( 'xprofile_group_' . $group_id, $group, 'bp' );
+			bp_cache_set( 'xprofile_group_' . $group_id, $group, 'bp' );
 		}
 
 		/**
Index: tests/phpunit/testcases/activity/cache.php
===================================================================
--- tests/phpunit/testcases/activity/cache.php
+++ tests/phpunit/testcases/activity/cache.php
@@ -23,7 +23,7 @@
 		bp_activity_get_meta( $a1, 'foo' );
 
 		// Ensure an empty cache for $a2
-		wp_cache_delete( $a2, 'activity_meta' );
+		bp_cache_delete( $a2, 'activity_meta' );
 
 		bp_activity_update_meta_cache( array( $a1, $a2 ) );
 
@@ -47,8 +47,8 @@
 		);
 
 		$found = array(
-			$a1 => wp_cache_get( $a1, 'activity_meta' ),
-			$a2 => wp_cache_get( $a2, 'activity_meta' ),
+			$a1 => bp_cache_get( $a1, 'activity_meta' ),
+			$a2 => bp_cache_get( $a2, 'activity_meta' ),
 		);
 
 		$this->assertEquals( $expected, $found );
Index: tests/phpunit/testcases/activity/functions.php
===================================================================
--- tests/phpunit/testcases/activity/functions.php
+++ tests/phpunit/testcases/activity/functions.php
@@ -305,12 +305,12 @@
 		$a = $this->factory->activity->create();
 		bp_activity_add_meta( $a, 'foo', 'bar' );
 		bp_activity_add_meta( $a, 'foo1', 'baz' );
-		$this->assertFalse( wp_cache_get( $a, 'activity_meta' ) );
+		$this->assertFalse( bp_cache_get( $a, 'activity_meta' ) );
 
 		// A single query should prime the whole meta cache
 		bp_activity_get_meta( $a, 'foo' );
 
-		$c = wp_cache_get( $a, 'activity_meta' );
+		$c = bp_cache_get( $a, 'activity_meta' );
 		$this->assertNotEmpty( $c['foo1'] );
 	}
 
@@ -947,7 +947,7 @@
 		) );
 
 		// should be populated
-		$this->assertNotEmpty( wp_cache_get( $a1, 'bp_activity_comments' ) );
+		$this->assertNotEmpty( bp_cache_get( $a1, 'bp_activity_comments' ) );
 
 		bp_activity_new_comment( array(
 			'activity_id' => $a1,
@@ -957,7 +957,7 @@
 		) );
 
 		// should be empty
-		$this->assertFalse( wp_cache_get( $a1, 'bp_activity_comments' ) );
+		$this->assertFalse( bp_cache_get( $a1, 'bp_activity_comments' ) );
 	}
 
 	/**
@@ -998,11 +998,11 @@
 		) );
 
 		// should be populated
-		$this->assertNotEmpty( wp_cache_get( $a1, 'bp_activity' ) );
-		$this->assertNotEmpty( wp_cache_get( $a2, 'bp_activity' ) );
-		$this->assertNotEmpty( wp_cache_get( $a3, 'bp_activity' ) );
-		$this->assertNotEmpty( wp_cache_get( $a4, 'bp_activity' ) );
-		$this->assertNotEmpty( wp_cache_get( $a5, 'bp_activity' ) );
+		$this->assertNotEmpty( bp_cache_get( $a1, 'bp_activity' ) );
+		$this->assertNotEmpty( bp_cache_get( $a2, 'bp_activity' ) );
+		$this->assertNotEmpty( bp_cache_get( $a3, 'bp_activity' ) );
+		$this->assertNotEmpty( bp_cache_get( $a4, 'bp_activity' ) );
+		$this->assertNotEmpty( bp_cache_get( $a5, 'bp_activity' ) );
 
 		// Stuff may run on bp_activity_comment_posted that loads the
 		// cache, so we use this dumb technique to check cache values
@@ -1053,7 +1053,7 @@
 		bp_activity_delete_comment( $a1, $a2 );
 
 		// assert comment cache as empty for $a1
-		$this->assertEmpty( wp_cache_get( $a1, 'bp_activity_comments' ) );
+		$this->assertEmpty( bp_cache_get( $a1, 'bp_activity_comments' ) );
 	}
 
 	/**
@@ -1190,7 +1190,7 @@
 
 	public function check_activity_caches() {
 		foreach ( $this->acaches as $k => $v ) {
-			$this->acaches[ $k ] = wp_cache_get( $k, 'bp_activity' );
+			$this->acaches[ $k ] = bp_cache_get( $k, 'bp_activity' );
 		}
 	}
 }
Index: tests/phpunit/testcases/activity/template.php
===================================================================
--- tests/phpunit/testcases/activity/template.php
+++ tests/phpunit/testcases/activity/template.php
@@ -886,8 +886,8 @@
 			'update_meta_cache' => false,
 		) );
 
-		$this->assertFalse( wp_cache_get( $a1, 'activity_meta' ) );
-		$this->assertFalse( wp_cache_get( $a2, 'activity_meta' ) );
+		$this->assertFalse( bp_cache_get( $a1, 'activity_meta' ) );
+		$this->assertFalse( bp_cache_get( $a2, 'activity_meta' ) );
 	}
 
 	/**
@@ -913,8 +913,8 @@
 			'update_meta_cache' => true,
 		) );
 
-		$this->assertNotEmpty( wp_cache_get( $a1, 'activity_meta' ) );
-		$this->assertNotEmpty( wp_cache_get( $a2, 'activity_meta' ) );
+		$this->assertNotEmpty( bp_cache_get( $a1, 'activity_meta' ) );
+		$this->assertNotEmpty( bp_cache_get( $a2, 'activity_meta' ) );
 	}
 
 	/**
Index: tests/phpunit/testcases/blogs/cache.php
===================================================================
--- tests/phpunit/testcases/blogs/cache.php
+++ tests/phpunit/testcases/blogs/cache.php
@@ -30,12 +30,12 @@
 		$b2_last_activity = bp_blogs_get_blogmeta( $b2, 'last_activity' );
 
 		// Clear caches (due to _get_)
-		wp_cache_delete( $b1, 'blog_meta' );
-		wp_cache_delete( $b2, 'blog_meta' );
+		bp_cache_delete( $b1, 'blog_meta' );
+		bp_cache_delete( $b2, 'blog_meta' );
 
 		// Caches should be empty
-		$this->assertFalse( wp_cache_get( $b1, 'blog_meta' ) );
-		$this->assertFalse( wp_cache_get( $b2, 'blog_meta' ) );
+		$this->assertFalse( bp_cache_get( $b1, 'blog_meta' ) );
+		$this->assertFalse( bp_cache_get( $b2, 'blog_meta' ) );
 
 		bp_blogs_update_meta_cache( array( $b1, $b2 ) );
 
@@ -74,12 +74,12 @@
 
 		// The cache may contain more than just this, so loop through
 		// and check only relevant keys
-		$b1_found = wp_cache_get( $b1, 'blog_meta' );
+		$b1_found = bp_cache_get( $b1, 'blog_meta' );
 		foreach ( $b1_expected as $k => $v ) {
 			$this->assertSame( $v, $b1_found[ $k ] );
 		}
 
-		$b2_found = wp_cache_get( $b2, 'blog_meta' );
+		$b2_found = bp_cache_get( $b2, 'blog_meta' );
 		foreach ( $b2_expected as $k => $v ) {
 			$this->assertSame( $v, $b2_found[ $k ] );
 		}
@@ -120,12 +120,12 @@
 		$b2_last_activity = bp_blogs_get_blogmeta( $b2, 'last_activity' );
 
 		// Clear caches (due to _get_)
-		wp_cache_delete( $b1, 'blog_meta' );
-		wp_cache_delete( $b2, 'blog_meta' );
+		bp_cache_delete( $b1, 'blog_meta' );
+		bp_cache_delete( $b2, 'blog_meta' );
 
 		// Caches should be empty
-		$this->assertFalse( wp_cache_get( $b1, 'blog_meta' ) );
-		$this->assertFalse( wp_cache_get( $b2, 'blog_meta' ) );
+		$this->assertFalse( bp_cache_get( $b1, 'blog_meta' ) );
+		$this->assertFalse( bp_cache_get( $b2, 'blog_meta' ) );
 
 		bp_has_blogs( array(
 			'user_id' => $u,
@@ -166,12 +166,12 @@
 
 		// The cache may contain more than just this, so loop through
 		// and check only relevant keys
-		$b1_found = wp_cache_get( $b1, 'blog_meta' );
+		$b1_found = bp_cache_get( $b1, 'blog_meta' );
 		foreach ( $b1_expected as $k => $v ) {
 			$this->assertSame( $v, $b1_found[ $k ] );
 		}
 
-		$b2_found = wp_cache_get( $b2, 'blog_meta' );
+		$b2_found = bp_cache_get( $b2, 'blog_meta' );
 		foreach ( $b2_expected as $k => $v ) {
 			$this->assertSame( $v, $b2_found[ $k ] );
 		}
@@ -214,20 +214,20 @@
 		$b2_last_activity = bp_blogs_get_blogmeta( $b2, 'last_activity' );
 
 		// Clear caches (due to _get_)
-		wp_cache_delete( $b1, 'blog_meta' );
-		wp_cache_delete( $b2, 'blog_meta' );
+		bp_cache_delete( $b1, 'blog_meta' );
+		bp_cache_delete( $b2, 'blog_meta' );
 
 		// Caches should be empty
-		$this->assertFalse( wp_cache_get( $b1, 'blog_meta' ) );
-		$this->assertFalse( wp_cache_get( $b2, 'blog_meta' ) );
+		$this->assertFalse( bp_cache_get( $b1, 'blog_meta' ) );
+		$this->assertFalse( bp_cache_get( $b2, 'blog_meta' ) );
 
 		bp_has_blogs( array(
 			'update_meta_cache' => false,
 		) );
 
 		// Caches should be empty
-		$this->assertFalse( wp_cache_get( $b1, 'blog_meta' ) );
-		$this->assertFalse( wp_cache_get( $b2, 'blog_meta' ) );
+		$this->assertFalse( bp_cache_get( $b1, 'blog_meta' ) );
+		$this->assertFalse( bp_cache_get( $b2, 'blog_meta' ) );
 
 		$this->set_current_user( $old_user );
 	}
Index: tests/phpunit/testcases/core/cache.php
===================================================================
--- tests/phpunit/testcases/core/cache.php
+++ tests/phpunit/testcases/core/cache.php
@@ -24,7 +24,7 @@
 			'object_column' => 'activity_id',
 		) );
 
-		$this->assertSame( array(), wp_cache_get( $a1, 'activity_meta' ) );
+		$this->assertSame( array(), bp_cache_get( $a1, 'activity_meta' ) );
 	}
 }
 
Index: tests/phpunit/testcases/core/class-bp-core-user.php
===================================================================
--- tests/phpunit/testcases/core/class-bp-core-user.php
+++ tests/phpunit/testcases/core/class-bp-core-user.php
@@ -200,12 +200,12 @@
 
 		// Cache is set during user creation. Clear to reflect actual
 		// pageload
-		wp_cache_delete( $u, 'bp_last_activity' );
+		bp_cache_delete( $u, 'bp_last_activity' );
 
 		// prime cache
 		$a = BP_Core_User::get_last_activity( $u );
 
-		$this->assertSame( $a[ $u ], wp_cache_get( $u, 'bp_last_activity' ) );
+		$this->assertSame( $a[ $u ], bp_cache_get( $u, 'bp_last_activity' ) );
 	}
 
 	/**
@@ -219,14 +219,14 @@
 
 		// Cache is set during user creation. Clear to reflect actual
 		// pageload
-		wp_cache_delete( $u1, 'bp_last_activity' );
-		wp_cache_delete( $u2, 'bp_last_activity' );
+		bp_cache_delete( $u1, 'bp_last_activity' );
+		bp_cache_delete( $u2, 'bp_last_activity' );
 
 		// prime cache
 		$a = BP_Core_User::get_last_activity( array( $u1, $u2 ) );
 
-		$this->assertSame( $a[ $u1 ], wp_cache_get( $u1, 'bp_last_activity' ) );
-		$this->assertSame( $a[ $u2 ], wp_cache_get( $u2, 'bp_last_activity' ) );
+		$this->assertSame( $a[ $u1 ], bp_cache_get( $u1, 'bp_last_activity' ) );
+		$this->assertSame( $a[ $u2 ], bp_cache_get( $u2, 'bp_last_activity' ) );
 	}
 
 	/**
@@ -241,7 +241,7 @@
 
 		// Cache is set during user creation. Clear to reflect actual
 		// pageload
-		wp_cache_delete( $u, 'bp_last_activity' );
+		bp_cache_delete( $u, 'bp_last_activity' );
 
 		// Prime cache
 		$uncached = BP_Core_User::get_last_activity( $u );
@@ -265,15 +265,15 @@
 		BP_Core_User::update_last_activity( $u2, $time );
 
 		// Cache is set during user creation. Clear to reflect actual pageload
-		wp_cache_delete( $u1, 'bp_last_activity' );
-		wp_cache_delete( $u2, 'bp_last_activity' );
+		bp_cache_delete( $u1, 'bp_last_activity' );
+		bp_cache_delete( $u2, 'bp_last_activity' );
 
 		// Prime cache
 		$uncached = BP_Core_User::get_last_activity( array( $u1, $u2 ) );
 
 		// Second grab will be from the cache
 		$cached = BP_Core_User::get_last_activity( array( $u1, $u2 ) );
-		$cached_u1 = wp_cache_get( $u1, 'bp_last_activity' );
+		$cached_u1 = bp_cache_get( $u1, 'bp_last_activity' );
 
 		$this->assertSame( $cached, $uncached );
 	}
Index: tests/phpunit/testcases/core/class-bp-user-query.php
===================================================================
--- tests/phpunit/testcases/core/class-bp-user-query.php
+++ tests/phpunit/testcases/core/class-bp-user-query.php
@@ -514,9 +514,9 @@
 			'include' => $users,
 		) );
 
-		$this->assertSame( 'foo', wp_cache_get( $users[0], 'bp_member_type' ) );
-		$this->assertSame( 'bar', wp_cache_get( $users[1], 'bp_member_type' ) );
-		$this->assertSame( 'foo', wp_cache_get( $users[2], 'bp_member_type' ) );
-		$this->assertSame( '', wp_cache_get( $users[3], 'bp_member_type' ) );
+		$this->assertSame( 'foo', bp_cache_get( $users[0], 'bp_member_type' ) );
+		$this->assertSame( 'bar', bp_cache_get( $users[1], 'bp_member_type' ) );
+		$this->assertSame( 'foo', bp_cache_get( $users[2], 'bp_member_type' ) );
+		$this->assertSame( '', bp_cache_get( $users[3], 'bp_member_type' ) );
 	}
 }
Index: tests/phpunit/testcases/core/functions.php
===================================================================
--- tests/phpunit/testcases/core/functions.php
+++ tests/phpunit/testcases/core/functions.php
@@ -416,7 +416,7 @@
 
 		restore_current_blog();
 
-		$this->assertFalse( wp_cache_get( 'directory_pages', 'bp' ) );
+		$this->assertFalse( bp_cache_get( 'directory_pages', 'bp' ) );
 	}
 
 	/**
@@ -556,7 +556,7 @@
 		$v = bp_get_option( 'bp-pages' );
 		bp_update_option( 'bp-pages', 'foo' );
 
-		$this->assertFalse( wp_cache_get( 'directory_pages', 'bp' ) );
+		$this->assertFalse( bp_cache_get( 'directory_pages', 'bp' ) );
 
 		bp_update_option( 'bp-pages', $v );
 	}
@@ -575,7 +575,7 @@
 
 			bp_update_option( $key, 'foo' );
 
-			$this->assertFalse( wp_cache_get( 'root_blog_options', 'bp' ), 'Cache not invalidated after updating "' . $key . '"' );
+			$this->assertFalse( bp_cache_get( 'root_blog_options', 'bp' ), 'Cache not invalidated after updating "' . $key . '"' );
 		}
 
 		if ( is_multisite() ) {
@@ -591,7 +591,7 @@
 
 				update_site_option( $ms_key, 'foooooooo' );
 
-				$this->assertFalse( wp_cache_get( 'root_blog_options', 'bp' ), 'Cache not invalidated after updating "' . $ms_key . '"' );
+				$this->assertFalse( bp_cache_get( 'root_blog_options', 'bp' ), 'Cache not invalidated after updating "' . $ms_key . '"' );
 			}
 		}
 	}
Index: tests/phpunit/testcases/groups/cache.php
===================================================================
--- tests/phpunit/testcases/groups/cache.php
+++ tests/phpunit/testcases/groups/cache.php
@@ -28,7 +28,7 @@
 		groups_get_groupmeta( $g1, 'foo' );
 
 		// Ensure an empty cache for $g2
-		wp_cache_delete( $g2, 'group_meta' );
+		bp_cache_delete( $g2, 'group_meta' );
 
 		bp_groups_update_meta_cache( array( $g1, $g2 ) );
 
@@ -58,8 +58,8 @@
 		);
 
 		$found = array(
-			$g1 => wp_cache_get( $g1, 'group_meta' ),
-			$g2 => wp_cache_get( $g2, 'group_meta' ),
+			$g1 => bp_cache_get( $g1, 'group_meta' ),
+			$g2 => bp_cache_get( $g2, 'group_meta' ),
 		);
 
 		$this->assertEquals( $expected, $found );
@@ -75,12 +75,12 @@
 		// Prime cache
 		groups_get_group( array( 'group_id' => $g, ) );
 
-		$this->assertNotEmpty( wp_cache_get( $g, 'bp_groups' ) );
+		$this->assertNotEmpty( bp_cache_get( $g, 'bp_groups' ) );
 
 		// Trigger flush
 		groups_update_groupmeta( $g, 'foo', 'bar' );
 
-		$this->assertFalse( wp_cache_get( $g, 'bp_groups' ) );
+		$this->assertFalse( bp_cache_get( $g, 'bp_groups' ) );
 	}
 
 	/**
@@ -94,11 +94,11 @@
 		groups_update_groupmeta( $g, 'foo', 'bar' );
 		groups_get_group( array( 'group_id' => $g ) );
 
-		$this->assertNotEmpty( wp_cache_get( $g, 'bp_groups' ) );
+		$this->assertNotEmpty( bp_cache_get( $g, 'bp_groups' ) );
 
 		// Trigger flush
 		groups_update_groupmeta( $g, 'foo', 'baz' );
-		$this->assertFalse( wp_cache_get( $g, 'bp_groups' ) );
+		$this->assertFalse( bp_cache_get( $g, 'bp_groups' ) );
 	}
 
 	/**
@@ -122,7 +122,7 @@
 
 		// This assertion is not really necessary - just checks to see
 		// whether a fatal error has occurred above
-		$this->assertNotEmpty( wp_cache_get( $g, 'bp_groups' ) );
+		$this->assertNotEmpty( bp_cache_get( $g, 'bp_groups' ) );
 	}
 
 	/**
@@ -151,8 +151,8 @@
 
 		bp_groups_prefetch_activity_object_data( $activities );
 
-		$this->assertNotEmpty( wp_cache_get( $g1, 'bp_groups' ) );
-		$this->assertNotEmpty( wp_cache_get( $g2, 'bp_groups' ) );
+		$this->assertNotEmpty( bp_cache_get( $g1, 'bp_groups' ) );
+		$this->assertNotEmpty( bp_cache_get( $g2, 'bp_groups' ) );
 	}
 
 	/**
@@ -174,7 +174,7 @@
 		groups_promote_member( $u2, $g, 'admin' );
 
 		// assert that cache is invalidated
-		$this->assertEmpty( wp_cache_get( $g, 'bp_group_admins' ) );
+		$this->assertEmpty( bp_cache_get( $g, 'bp_group_admins' ) );
 
 		// assert new cached value
 		$this->assertEquals( 2, count( groups_get_group_admins( $g ) ) );
@@ -195,7 +195,7 @@
 		self::add_user_to_group( $u2, $g, array( 'is_admin' => 1 ) );
 
 		// assert that cache is invalidated
-		$this->assertEmpty( wp_cache_get( $g, 'bp_group_admins' ) );
+		$this->assertEmpty( bp_cache_get( $g, 'bp_group_admins' ) );
 
 		// assert new cached value
 		$this->assertEquals( 2, count( groups_get_group_admins( $g ) ) );
Index: tests/phpunit/testcases/groups/class-bp-groups-group.php
===================================================================
--- tests/phpunit/testcases/groups/class-bp-groups-group.php
+++ tests/phpunit/testcases/groups/class-bp-groups-group.php
@@ -841,12 +841,12 @@
 		// Prime cache
 		groups_get_group( array( 'group_id' => $g, ) );
 
-		$this->assertNotEmpty( wp_cache_get( $g, 'bp_groups' ) );
+		$this->assertNotEmpty( bp_cache_get( $g, 'bp_groups' ) );
 
 		$group = new BP_Groups_Group( $g );
 		$group->delete();
 
-		$this->assertFalse( wp_cache_get( $g, 'bp_groups' ) );
+		$this->assertFalse( bp_cache_get( $g, 'bp_groups' ) );
 	}
 
 	/**
@@ -859,13 +859,13 @@
 		// Prime cache
 		groups_get_group( array( 'group_id' => $g, ) );
 
-		$this->assertNotEmpty( wp_cache_get( $g, 'bp_groups' ) );
+		$this->assertNotEmpty( bp_cache_get( $g, 'bp_groups' ) );
 
 		$group = new BP_Groups_Group( $g );
 		$group->name = 'Foo';
 		$group->save();
 
-		$this->assertFalse( wp_cache_get( $g, 'bp_groups' ) );
+		$this->assertFalse( bp_cache_get( $g, 'bp_groups' ) );
 	}
 	/**
 	 * @group get_group_extras
Index: tests/phpunit/testcases/groups/functions.php
===================================================================
--- tests/phpunit/testcases/groups/functions.php
+++ tests/phpunit/testcases/groups/functions.php
@@ -443,7 +443,7 @@
 		// Get rid of any auto-created values
 		global $wpdb, $bp;
 		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d", $g ) );
-		wp_cache_delete( $g, 'group_meta' );
+		bp_cache_delete( $g, 'group_meta' );
 
 		$metas = groups_get_groupmeta( $g );
 		$this->assertSame( array(), $metas );
@@ -489,12 +489,12 @@
 		$g = $this->factory->group->create();
 		groups_add_groupmeta( $g, 'foo', 'bar' );
 		groups_add_groupmeta( $g, 'foo1', 'baz' );
-		$this->assertFalse( wp_cache_get( $g, 'group_meta' ) );
+		$this->assertFalse( bp_cache_get( $g, 'group_meta' ) );
 
 		// A single query should prime the whole meta cache
 		groups_get_groupmeta( $g, 'foo' );
 
-		$c = wp_cache_get( $g, 'group_meta' );
+		$c = bp_cache_get( $g, 'group_meta' );
 		$this->assertNotEmpty( $c['foo1'] );
 	}
 
Index: tests/phpunit/testcases/members/cache.php
===================================================================
--- tests/phpunit/testcases/members/cache.php
+++ tests/phpunit/testcases/members/cache.php
@@ -13,7 +13,7 @@
 		global $wpdb;
 
 		// set cached value to zero
-		wp_cache_set( 'bp_total_member_count', 0, 'bp' );
+		bp_cache_set( 'bp_total_member_count', 0, 'bp' );
 		$num_queries = $wpdb->num_queries;
 
 		// run function
Index: tests/phpunit/testcases/members/functions.php
===================================================================
--- tests/phpunit/testcases/members/functions.php
+++ tests/phpunit/testcases/members/functions.php
@@ -125,7 +125,7 @@
 		) );
 		bp_core_get_user_displayname( $u );
 
-		$this->assertSame( 'Foo', wp_cache_get( 'bp_user_fullname_' . $u, 'bp' ) );
+		$this->assertSame( 'Foo', bp_cache_get( 'bp_user_fullname_' . $u, 'bp' ) );
 
 		if ( ! $xprofile_is_active ) {
 			unset( buddypress()->active_components['xprofile'] );
@@ -143,7 +143,7 @@
 		$u = $this->factory->user->create();
 		xprofile_set_field_data( 1, $u, 'Foo Foo' );
 
-		$this->assertFalse( wp_cache_get( 'bp_user_fullname_' . $u, 'bp' ) );
+		$this->assertFalse( bp_cache_get( 'bp_user_fullname_' . $u, 'bp' ) );
 
 		if ( ! $xprofile_is_active ) {
 			unset( buddypress()->active_components['xprofile'] );
@@ -182,8 +182,8 @@
 		// field through the API
 		global $wpdb, $bp;
 		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = 1", $u ) );
-		wp_cache_delete( 'bp_user_fullname_' . $u, 'bp' );
-		wp_cache_delete( 1, 'bp_xprofile_data_' . $u, 'bp' );
+		bp_cache_delete( 'bp_user_fullname_' . $u, 'bp' );
+		bp_cache_delete( 1, 'bp_xprofile_data_' . $u, 'bp' );
 
 		$this->assertSame( '', xprofile_get_field_data( 1, $u ) );
 		$this->assertSame( 'Foo Foo', bp_core_get_user_displayname( $u ) );
@@ -234,8 +234,8 @@
 		// field through the API
 		global $wpdb, $bp;
 		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = 1", $u2 ) );
-		wp_cache_delete( 'bp_user_fullname_' . $u2, 'bp' );
-		wp_cache_delete( 1, 'bp_xprofile_data_' . $u2, 'bp' );
+		bp_cache_delete( 'bp_user_fullname_' . $u2, 'bp' );
+		bp_cache_delete( 1, 'bp_xprofile_data_' . $u2, 'bp' );
 
 		$expected = array(
 			$u1 => 'Foo',
@@ -254,7 +254,7 @@
 
 		// Fake the cache for $u2
 		$u2 = 123;
-		wp_cache_set( 'bp_user_fullname_' . $u2, 'Bar', 'bp' );
+		bp_cache_set( 'bp_user_fullname_' . $u2, 'Bar', 'bp' );
 
 		$expected = array(
 			$u1 => 'Foo',
Index: tests/phpunit/testcases/members/template.php
===================================================================
--- tests/phpunit/testcases/members/template.php
+++ tests/phpunit/testcases/members/template.php
@@ -106,7 +106,7 @@
 		// confused. Never comes up when BP runs normally, because the
 		// loggedin_user doesn't change on a pageload. @todo Fix for
 		// real in BP
-		wp_cache_delete( 'bp_user_domain_' . $u2, 'bp' );
+		bp_cache_delete( 'bp_user_domain_' . $u2, 'bp' );
 
 		$this->go_to( bp_core_get_user_domain( $u2 ) . bp_get_friends_slug() . '/requests/' );
 		$this->restore_admins();
Index: tests/phpunit/testcases/members/types.php
===================================================================
--- tests/phpunit/testcases/members/types.php
+++ tests/phpunit/testcases/members/types.php
@@ -137,7 +137,7 @@
 			wp_delete_user( $u );
 		}
 
-		$this->assertFalse( wp_cache_get( $u, 'bp_member_type' ) );
+		$this->assertFalse( bp_cache_get( $u, 'bp_member_type' ) );
 		$this->assertFalse( bp_get_member_type( $u ) );
 	}
 }
Index: tests/phpunit/testcases/messages/cache.php
===================================================================
--- tests/phpunit/testcases/messages/cache.php
+++ tests/phpunit/testcases/messages/cache.php
@@ -42,7 +42,7 @@
 		bp_messages_get_meta( $m1, 'utensil' );
 
 		// Ensure an empty cache for second message
-		wp_cache_delete( $m2, 'message_meta' );
+		bp_cache_delete( $m2, 'message_meta' );
 
 		// update message meta cache
 		bp_messages_update_meta_cache( array( $m1, $m2 ) );
@@ -70,8 +70,8 @@
 		);
 
 		$found = array(
-			$m1 => wp_cache_get( $m1, 'message_meta' ),
-			$m2 => wp_cache_get( $m2, 'message_meta' ),
+			$m1 => bp_cache_get( $m1, 'message_meta' ),
+			$m2 => bp_cache_get( $m2, 'message_meta' ),
 		);
 
 		$this->assertEquals( $expected, $found );
@@ -102,7 +102,7 @@
 			'update_meta_cache' => true
 		) );
 
-		$this->assertNotEmpty( wp_cache_get( $m1, 'message_meta' ) );
+		$this->assertNotEmpty( bp_cache_get( $m1, 'message_meta' ) );
 	}
 
 	/**
@@ -147,8 +147,8 @@
 		messages_delete_thread( $t1 );
 
 		// assert empty meta cache
-		$this->assertEmpty( wp_cache_get( $m1, 'message_meta' ) );
-		$this->assertEmpty( wp_cache_get( $m2, 'message_meta' ) );
+		$this->assertEmpty( bp_cache_get( $m1, 'message_meta' ) );
+		$this->assertEmpty( bp_cache_get( $m2, 'message_meta' ) );
 
 		// cleanup
 		$this->set_current_user( $this->old_current_user );
Index: tests/phpunit/testcases/messages/class.bp-messages-notice.php
===================================================================
--- tests/phpunit/testcases/messages/class.bp-messages-notice.php
+++ tests/phpunit/testcases/messages/class.bp-messages-notice.php
@@ -34,7 +34,7 @@
 
 		// deactivate notice and make sure cache is invalidated
 		$notice->deactivate();
-		$this->assertFalse( wp_cache_get( 'active_notice', 'bp_messages' ) );
+		$this->assertFalse( bp_cache_get( 'active_notice', 'bp_messages' ) );
 
 		// create a new notice
 		$subject2 = 'Another notice';
@@ -45,7 +45,7 @@
 		BP_Messages_Notice::get_active();
 
 		// grab the cache and make sure it equals our new notice
-		$cache = wp_cache_get( 'active_notice', 'bp_messages' );
+		$cache = bp_cache_get( 'active_notice', 'bp_messages' );
 		$this->assertEquals( $subject2, $cache->subject );
 		$this->assertEquals( $message2, $cache->message );
 	}
Index: tests/phpunit/testcases/notifications/functions.php
===================================================================
--- tests/phpunit/testcases/notifications/functions.php
+++ tests/phpunit/testcases/notifications/functions.php
@@ -29,7 +29,7 @@
 			'item_id' => 2,
 		) );
 
-		$this->assertFalse( wp_cache_get( 'all_for_user_' . $u, 'bp_notifications' ) );
+		$this->assertFalse( bp_cache_get( 'all_for_user_' . $u, 'bp_notifications' ) );
 	}
 
 	public function test_cache_invalidation_all_for_user_on_delete() {
@@ -52,7 +52,7 @@
 		// delete
 		BP_Notifications_Notification::delete( array( 'id' => $n1, ) );
 
-		$this->assertFalse( wp_cache_get( 'all_for_user_' . $u, 'bp_notifications' ) );
+		$this->assertFalse( bp_cache_get( 'all_for_user_' . $u, 'bp_notifications' ) );
 	}
 
 	/**
Index: tests/phpunit/testcases/xprofile/cache.php
===================================================================
--- tests/phpunit/testcases/xprofile/cache.php
+++ tests/phpunit/testcases/xprofile/cache.php
@@ -40,7 +40,7 @@
 			),
 		);
 
-		$this->assertSame( $g_expected, wp_cache_get( $g, 'xprofile_group_meta' ) );
+		$this->assertSame( $g_expected, bp_cache_get( $g, 'xprofile_group_meta' ) );
 
 		$f_expected = array(
 			'field_foo' => array(
@@ -48,7 +48,7 @@
 			),
 		);
 
-		$this->assertSame( $f_expected, wp_cache_get( $f, 'xprofile_field_meta' ) );
+		$this->assertSame( $f_expected, bp_cache_get( $f, 'xprofile_field_meta' ) );
 
 		$d_expected = array(
 			'data_foo' => array(
@@ -56,7 +56,7 @@
 			),
 		);
 
-		$this->assertSame( $d_expected, wp_cache_get( $d->id, 'xprofile_data_meta' ) );
+		$this->assertSame( $d_expected, bp_cache_get( $d->id, 'xprofile_data_meta' ) );
 	}
 
 	/**
@@ -94,7 +94,7 @@
 			),
 		);
 
-		$this->assertSame( $g_expected, wp_cache_get( $g, 'xprofile_group_meta' ) );
+		$this->assertSame( $g_expected, bp_cache_get( $g, 'xprofile_group_meta' ) );
 
 		$f_expected = array(
 			'field_foo' => array(
@@ -102,7 +102,7 @@
 			),
 		);
 
-		$this->assertSame( $f_expected, wp_cache_get( $f, 'xprofile_field_meta' ) );
+		$this->assertSame( $f_expected, bp_cache_get( $f, 'xprofile_field_meta' ) );
 
 		$d_expected = array(
 			'data_foo' => array(
@@ -110,7 +110,7 @@
 			),
 		);
 
-		$this->assertSame( $d_expected, wp_cache_get( $d->id, 'xprofile_data_meta' ) );
+		$this->assertSame( $d_expected, bp_cache_get( $d->id, 'xprofile_data_meta' ) );
 	}
 
 	/**
@@ -143,8 +143,8 @@
 			'update_meta_cache' => false,
 		) );
 
-		$this->assertFalse( wp_cache_get( $g, 'xprofile_group_meta' ) );
-		$this->assertFalse( wp_cache_get( $f, 'xprofile_field_meta' ) );
-		$this->assertFalse( wp_cache_get( $d->id, 'xprofile_data_meta' ) );
+		$this->assertFalse( bp_cache_get( $g, 'xprofile_group_meta' ) );
+		$this->assertFalse( bp_cache_get( $f, 'xprofile_field_meta' ) );
+		$this->assertFalse( bp_cache_get( $d->id, 'xprofile_data_meta' ) );
 	}
 }
Index: tests/phpunit/testcases/xprofile/class-bp-xprofile-profiledata.php
===================================================================
--- tests/phpunit/testcases/xprofile/class-bp-xprofile-profiledata.php
+++ tests/phpunit/testcases/xprofile/class-bp-xprofile-profiledata.php
@@ -36,7 +36,7 @@
 
 		$d = new BP_XProfile_ProfileData( $f, $u );
 
-		wp_cache_delete( $f, 'bp_xprofile_data_' . $u );
+		bp_cache_delete( "{$u}:{$f}", 'bp_xprofile_data' );
 
 		$this->assertTrue( $d->exists() );
 	}
@@ -56,7 +56,7 @@
 		// Fake the cache
 		$c = new stdClass;
 		$c->id = 3;
-		wp_cache_set( $f, $c, 'bp_xprofile_data_' . $u );
+		bp_cache_set( "{$u}:{$f}", $c, 'bp_xprofile_data' );
 
 		$this->assertTrue( $d->exists() );
 	}
@@ -73,7 +73,7 @@
 		) );
 
 		// Just to be sure
-		wp_cache_delete( $f, 'bp_xprofile_data_' . $u );
+		bp_cache_delete( "{$u}:{$f}", 'bp_xprofile_data' );
 
 		$this->assertEquals( 0, BP_XProfile_ProfileData::get_fielddataid_byid( $f, $u ) );
 	}
@@ -96,7 +96,7 @@
 		$d->save();
 
 		// Ensure it's deleted from cache
-		wp_cache_delete( $f, 'bp_xprofile_data_' . $u );
+		bp_cache_delete( "{$u}:{$f}", 'bp_xprofile_data' );
 
 		$this->assertEquals( $d->id, BP_XProfile_ProfileData::get_fielddataid_byid( $f, $u ) );
 	}
@@ -115,7 +115,7 @@
 		// Fake the cache
 		$d = new stdClass;
 		$d->id = 5;
-		wp_cache_set( $f, $d, 'bp_xprofile_data_' . $u );
+		bp_cache_set( "{$u}:{$f}", $d, 'bp_xprofile_data' );
 
 		$this->assertSame( 5, BP_XProfile_ProfileData::get_fielddataid_byid( $f, $u ) );
 	}
@@ -138,7 +138,7 @@
 		$d->save();
 
 		// Ensure it's deleted from cache
-		wp_cache_delete( $f, 'bp_xprofile_data_' . $u );
+		bp_cache_delete( "{$u}:{$f}", 'bp_xprofile_data' );
 
 		$this->assertSame( 'foo', BP_XProfile_ProfileData::get_value_byid( $f, $u ) );
 	}
@@ -179,8 +179,8 @@
 		remove_filter( 'xprofile_data_last_updated_before_save', array( $this, 'filter_time' ) );
 
 		// Ensure it's deleted from cache
-		wp_cache_delete( $f, 'bp_xprofile_data_' . $u1 );
-		wp_cache_delete( $f, 'bp_xprofile_data_' . $u2 );
+		bp_cache_delete( "{$u1}:{$f}", 'bp_xprofile_data' );
+		bp_cache_delete( "{$u2}:{$f}", 'bp_xprofile_data' );
 
 		$eu1 = new stdClass;
 		$eu1->user_id = $u1;
@@ -218,7 +218,7 @@
 		$d = new stdClass;
 		$d->value = 'foo';
 		$d->field_id = $f;
-		wp_cache_set( $f, $d, 'bp_xprofile_data_' . $u );
+		bp_cache_set( "{$u}:{$f}", $d, 'bp_xprofile_data' );
 
 		$this->assertSame( 'foo', BP_XProfile_ProfileData::get_value_byid( $f, $u ) );
 	}
@@ -252,8 +252,8 @@
 		$d2->value = 'bar';
 		$d2->last_updated = $time;
 
-		wp_cache_set( $f, $d1, 'bp_xprofile_data_' . $u1 );
-		wp_cache_set( $f, $d2, 'bp_xprofile_data_' . $u2 );
+		bp_cache_set( "{$u1}:{$f}", $d1, 'bp_xprofile_data' );
+		bp_cache_set( "{$u2}:{$f}", $d2, 'bp_xprofile_data' );
 
 		$eu1 = new stdClass;
 		$eu1->id = 10;
@@ -313,8 +313,8 @@
 		$d2->save();
 
 		// Ensure it's deleted from cache
-		wp_cache_delete( $f1, 'bp_xprofile_data_' . $u );
-		wp_cache_delete( $f2, 'bp_xprofile_data_' . $u );
+		bp_cache_delete( "{$u}:{$f1}", 'bp_xprofile_data' );
+		bp_cache_delete( "{$u}:{$f2}", 'bp_xprofile_data' );
 
 		$u_obj = new WP_User( $u );
 
@@ -389,8 +389,8 @@
 		$d2->last_updated = $time;
 		$d2->id = 2;
 
-		wp_cache_set( $f1, $d1, 'bp_xprofile_data_' . $u );
-		wp_cache_set( $f2, $d2, 'bp_xprofile_data_' . $u );
+		bp_cache_set( "{$u}:{$f1}", $d1, 'bp_xprofile_data' );
+		bp_cache_set( "{$u}:{$f2}", $d2, 'bp_xprofile_data' );
 
 		$u_obj = new WP_User( $u );
 
Index: tests/phpunit/testcases/xprofile/functions.php
===================================================================
--- tests/phpunit/testcases/xprofile/functions.php
+++ tests/phpunit/testcases/xprofile/functions.php
@@ -91,7 +91,7 @@
 
 		bp_update_option( 'bp-xprofile-fullname-field-name', 'foo' );
 
-		$this->assertFalse( wp_cache_get( 'fullname_field_id', 'bp_xprofile' ) );
+		$this->assertFalse( bp_cache_get( 'fullname_field_id', 'bp_xprofile' ) );
 	}
 
 	/**
