diff --git bp-activity/bp-activity-classes.php bp-activity/bp-activity-classes.php
index 5d5a870..6d70a9d 100644
--- bp-activity/bp-activity-classes.php
+++ bp-activity/bp-activity-classes.php
@@ -1156,12 +1156,71 @@ class BP_Activity_Activity {
 	 *
 	 * @since BuddyPress (1.2)
 	 *
+	 * @param array $args
 	 * @return string ISO timestamp.
 	 */
-	public static function get_last_updated() {
+	public static function get_last_updated( $args = array() ) {
 		global $bp, $wpdb;
 
-		return $wpdb->get_var( "SELECT date_recorded FROM {$bp->activity->table_name} ORDER BY date_recorded DESC LIMIT 1" );
+		$r = bp_parse_args( $args, 
+			array(
+				'field_name'       => 'date_recorded',
+				'search_terms'     => false,
+				'filter'           => false,      // See self::get_filter_sql()
+				'display_comments' => 'threaded', // or stream or false
+				'show_hidden'      => false,      // Show items marked hide_sitewide
+			), 
+			'activity_last_updated' 
+		);
+		extract( $r );
+
+		if ( 'id' != $field_name ) {
+			return $wpdb->get_var( "SELECT date_recorded FROM {$bp->activity->table_name} ORDER BY date_recorded DESC LIMIT 1" );
+		}
+
+		$select_sql = "SELECT a.id FROM {$bp->activity->table_name} a";
+		$order_sql  = "ORDER BY a.id DESC";
+		$limit_sql  = "LIMIT 1";
+		$exclude_types = array();
+		$index_hint_sql = '';
+
+		$where_conditions['spam_sql'] = 'a.is_spam = 0';
+
+		// Searching
+		if ( $search_terms ) {
+			$search_terms = esc_sql( $search_terms );
+			$where_conditions['search_sql'] = "a.content LIKE '%%" . esc_sql( like_escape( $search_terms ) ) . "%%'";
+		}
+		// Filtering
+		if ( $filter && $filter_sql = BP_Activity_Activity::get_filter_sql( $filter ) ) {
+			$where_conditions['filter_sql'] = $filter_sql;
+		} else {
+			$index_hint_sql = "USE INDEX (type)";
+		}
+
+		if ( ! $show_hidden )
+			$where_conditions['hidden_sql'] = "a.hide_sitewide = 0";
+
+		if ( empty( $filter_array['action'] ) )
+			$exclude_types[] = 'last_activity';
+
+		if ( false === $display_comments || 'threaded' === $display_comments )
+			$exclude_types[] = 'activity_comment';
+
+		if ( ! empty( $exclude_types ) && $excluded_type = BP_Activity_Activity::get_in_operator_sql( 'a.type', $exclude_types ) ) {
+			$excluded_type = str_replace( 'a.type IN', 'a.type NOT IN', $excluded_type );
+			$where_conditions[] = $excluded_type;
+		}	
+
+		// Filter the where conditions
+		$where_conditions = apply_filters( 'bp_activity_get_last_updated_recorded_where', $where_conditions, $r );
+
+		// Join the where conditions together
+		$where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
+
+		$last_updated = $wpdb->get_var( apply_filters( 'bp_activity_get_last_updated_sql', "{$select_sql} {$index_hint_sql} {$where_sql} {$order_sql} {$limit_sql}", $select_sql, $index_hint_sql, $where_sql, $order_sql ) );
+
+		return absint( $last_updated );
 	}
 
 	/**
diff --git bp-activity/bp-activity-functions.php bp-activity/bp-activity-functions.php
index 12016cd..aaa2986 100644
--- bp-activity/bp-activity-functions.php
+++ bp-activity/bp-activity-functions.php
@@ -507,11 +507,32 @@ function bp_activity_check_exists_by_content( $content ) {
  *
  * @uses BP_Activity_Activity::get_last_updated() {@link BP_Activity_Activity}
  * @uses apply_filters() To call the 'bp_activity_get_last_updated' hook.
- *
- * @return string Date last updated.
+ * @param array args
+ * @return string|int Date last updated | Activity id of the last updated depending on args.
  */
-function bp_activity_get_last_updated() {
-	return apply_filters( 'bp_activity_get_last_updated', BP_Activity_Activity::get_last_updated() );
+function bp_activity_get_last_updated( $args = array() ) {
+	// date_recorded is default value and is used by BP_Activity_Feed
+	$field_name = 'date_recorded';
+
+	if ( ! empty( $args['field_name'] ) ) {
+		$field_name = 'id';
+	}
+
+	$last_updated = wp_cache_get( 'bp_activity_last_updated_' . $field_name , 'bp' );
+
+	if ( empty( $last_updated ) || ( is_array( $last_updated ) && $args != $last_updated['args'] ) ) {
+		$last_updated = BP_Activity_Activity::get_last_updated( $args );
+
+		if( 'id' == $field_name ) {
+			$last_updated = array( 'id' => $last_updated, 'args' => $args );
+		}
+
+		wp_cache_set( 'bp_activity_last_updated_' . $field_name, $last_updated, 'bp' );
+	} else {
+		return array_merge( $last_updated , array( ' cached' ) );
+	}
+
+	return apply_filters_ref_array( 'bp_activity_get_last_updated', array( &$last_updated,  &$args ) );
 }
 
 /**
@@ -1104,6 +1125,8 @@ function bp_activity_add( $args = '' ) {
 		BP_Activity_Activity::rebuild_activity_comment_tree( $activity->item_id );
 
 	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+	wp_cache_delete( 'bp_activity_last_updated_date_recorded', 'bp' );
+	wp_cache_delete( 'bp_activity_last_updated_id', 'bp' );
 	do_action( 'bp_activity_add', $params );
 
 	return $activity->id;
@@ -1355,6 +1378,11 @@ function bp_activity_delete( $args = '' ) {
 	do_action( 'bp_activity_deleted_activities', $activity_ids_deleted );
 
 	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+	wp_cache_delete( 'bp_activity_last_updated_date_recorded', 'bp' );
+	
+	if ( $last_updated_id == wp_cache_get( 'bp_activity_last_updated_id' , 'bp' ) && in_array( $last_updated_id['id'], $activity_ids_deleted ) ) {
+		wp_cache_delete( 'bp_activity_last_updated_id', 'bp' );
+	}
 
 	return true;
 }
@@ -1657,6 +1685,14 @@ function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
 	// Clear the activity stream first page cache
 	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
 
+	// Clear the last updated date_recorded cache
+	wp_cache_delete( 'bp_activity_last_updated_date_recorded', 'bp' );
+	
+	// Clear the last updated id if the spammed activity is the one that is cached
+	if ( $last_updated_id == wp_cache_get( 'bp_activity_last_updated_id' , 'bp' ) && $last_updated_id['id'] == $activity->id ) {
+		wp_cache_delete( 'bp_activity_last_updated_id', 'bp' );
+	}
+
 	// Clear the activity comment cache for this activity item
 	wp_cache_delete( 'bp_activity_comments_' . $activity->id, 'bp' );
 
@@ -1697,6 +1733,12 @@ function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
 	// Clear the activity stream first page cache
 	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
 
+	// Clear the last updated date_recorded cache
+	wp_cache_delete( 'bp_activity_last_updated_date_recorded', 'bp' );
+	
+	// Clear the last updated id cache
+	wp_cache_delete( 'bp_activity_last_updated_id', 'bp' );
+
 	// Clear the activity comment cache for this activity item
 	wp_cache_delete( 'bp_activity_comments_' . $activity->id, 'bp' );
 
