Index: src/wp-includes/query.php
===================================================================
--- src/wp-includes/query.php	(revision 37480)
+++ src/wp-includes/query.php	(working copy)
@@ -3280,9 +3280,21 @@
 			$cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
 			$corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
 
-			$comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits");
+			$key          = md5( serialize( array( $cjoin, $cwhere, $cgroupby, $corderby, $climits ) ) );
+			$last_changed = wp_cache_get( 'last_changed', 'comment' );
+			if ( ! $last_changed ) {
+				$last_changed = microtime();
+				wp_cache_set( 'last_changed', $last_changed, 'comment' );
+			}
+			$cache_key   = "get_comment_feed_ids:$key:$last_changed";
+			$comment_ids = wp_cache_get( $cache_key, 'comment' );
+			if ( false === $comment_ids ) {
+				$comment_ids = (array) $wpdb->get_results( "SELECT $distinct $wpdb->comments.comment_ID FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits" );
+				wp_cache_add( $cache_key, $comment_ids, 'comment' );
+			}
+
 			// Convert to WP_Comment
-			$this->comments = array_map( 'get_comment', $comments );
+			$this->comments = array_map( 'get_comment', $comment_ids );
 			$this->comment_count = count($this->comments);
 
 			$post_ids = array();
@@ -3652,10 +3664,21 @@
 			/** This filter is documented in wp-includes/query.php */
 			$climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
 
-			$comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits";
-			$comments = $wpdb->get_results($comments_request);
+			$key          = md5( serialize( array( $cjoin, $cwhere, $cgroupby, $corderby, $climits ) ) );
+			$last_changed = wp_cache_get( 'last_changed', 'comment' );
+			if ( ! $last_changed ) {
+				$last_changed = microtime();
+				wp_cache_set( 'last_changed', $last_changed, 'comment' );
+			}
+			$cache_key   = "get_comment_feed_ids:$key:$last_changed";
+			$comment_ids = wp_cache_get( $cache_key, 'comment' );
+			if ( false === $comment_ids ) {
+				$comment_ids = (array) $wpdb->get_results( "SELECT $distinct $wpdb->comments.comment_ID FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits" );
+				wp_cache_add( $cache_key, $comment_ids, 'comment' );
+			}
+
 			// Convert to WP_Comment
-			$this->comments = array_map( 'get_comment', $comments );
+			$this->comments = array_map( 'get_comment', $comment_ids );
 			$this->comment_count = count($this->comments);
 		}
 
