Index: src/wp-includes/class-wp-comment-query.php
===================================================================
--- src/wp-includes/class-wp-comment-query.php	(revision 38151)
+++ src/wp-includes/class-wp-comment-query.php	(working copy)
@@ -393,12 +393,9 @@
 
 		// $args can include anything. Only use the args defined in the query_var_defaults to compute the key.
 		$key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) );
-		$last_changed = wp_cache_get( 'last_changed', 'comment' );
-		if ( ! $last_changed ) {
-			$last_changed = microtime();
-			wp_cache_set( 'last_changed', $last_changed, 'comment' );
-		}
+		$last_changed = last_changed_cache( 'comment' );
 
+
 		$cache_key   = "get_comments:$key:$last_changed";
 		$cache_value = wp_cache_get( $cache_key, 'comment' );
 		if ( false === $cache_value ) {
@@ -972,11 +969,7 @@
 		}
 
 		$key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) );
-		$last_changed = wp_cache_get( 'last_changed', 'comment' );
-		if ( ! $last_changed ) {
-			$last_changed = microtime();
-			wp_cache_set( 'last_changed', $last_changed, 'comment' );
-		}
+		$last_changed = last_changed_cache( 'comment' );
 
 		// Fetch an entire level of the descendant tree at a time.
 		$level = 0;
Index: src/wp-includes/class-wp-network-query.php
===================================================================
--- src/wp-includes/class-wp-network-query.php	(revision 38151)
+++ src/wp-includes/class-wp-network-query.php	(working copy)
@@ -211,11 +211,7 @@
 
 		// $args can include anything. Only use the args defined in the query_var_defaults to compute the key.
 		$key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) );
-		$last_changed = wp_cache_get( 'last_changed', 'networks' );
-		if ( ! $last_changed ) {
-			$last_changed = microtime();
-			wp_cache_set( 'last_changed', $last_changed, 'networks' );
-		}
+		$last_changed = last_changed_cache( 'networks' );
 
 		$cache_key = "get_network_ids:$key:$last_changed";
 		$cache_value = wp_cache_get( $cache_key, 'networks' );
Index: src/wp-includes/class-wp-site-query.php
===================================================================
--- src/wp-includes/class-wp-site-query.php	(revision 38151)
+++ src/wp-includes/class-wp-site-query.php	(working copy)
@@ -247,11 +247,7 @@
 
 		// $args can include anything. Only use the args defined in the query_var_defaults to compute the key.
 		$key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) );
-		$last_changed = wp_cache_get( 'last_changed', 'sites' );
-		if ( ! $last_changed ) {
-			$last_changed = microtime();
-			wp_cache_set( 'last_changed', $last_changed, 'sites' );
-		}
+		$last_changed = last_changed_cache( 'sites' );
 
 		$cache_key = "get_sites:$key:$last_changed";
 		$cache_value = wp_cache_get( $cache_key, 'sites' );
Index: src/wp-includes/class-wp-term-query.php
===================================================================
--- src/wp-includes/class-wp-term-query.php	(revision 38151)
+++ src/wp-includes/class-wp-term-query.php	(working copy)
@@ -629,11 +629,7 @@
 
 		// $args can be anything. Only use the args defined in defaults to compute the key.
 		$key = md5( serialize( wp_array_slice_assoc( $args, array_keys( $this->query_var_defaults ) ) ) . serialize( $taxonomies ) . $this->request );
-		$last_changed = wp_cache_get( 'last_changed', 'terms' );
-		if ( ! $last_changed ) {
-			$last_changed = microtime();
-			wp_cache_set( 'last_changed', $last_changed, 'terms' );
-		}
+		$last_changed = last_changed_cache( 'terms' );
 		$cache_key = "get_terms:$key:$last_changed";
 		$cache = wp_cache_get( $cache_key, 'terms' );
 		if ( false !== $cache ) {
Index: src/wp-includes/functions.php
===================================================================
--- src/wp-includes/functions.php	(revision 38151)
+++ src/wp-includes/functions.php	(working copy)
@@ -5463,3 +5463,12 @@
 
 	return false;
 }
+
+function last_changed_cache( $group ){
+	$last_changed = wp_cache_get( 'last_changed', $group );
+	if ( ! $last_changed ) {
+		$last_changed = microtime();
+		wp_cache_set( 'last_changed', $last_changed, $group );
+	}
+	return $last_changed;
+}
\ No newline at end of file
Index: src/wp-includes/general-template.php
===================================================================
--- src/wp-includes/general-template.php	(revision 38151)
+++ src/wp-includes/general-template.php	(working copy)
@@ -1698,11 +1698,7 @@
 
 	$output = '';
 
-	$last_changed = wp_cache_get( 'last_changed', 'posts' );
-	if ( ! $last_changed ) {
-		$last_changed = microtime();
-		wp_cache_set( 'last_changed', $last_changed, 'posts' );
-	}
+	$last_changed = last_changed_cache( 'posts' );
 
 	$limit = $r['limit'];
 
Index: src/wp-includes/post.php
===================================================================
--- src/wp-includes/post.php	(revision 38151)
+++ src/wp-includes/post.php	(working copy)
@@ -4098,11 +4098,7 @@
 function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) {
 	global $wpdb;
 
-	$last_changed = wp_cache_get( 'last_changed', 'posts' );
-	if ( false === $last_changed ) {
-		$last_changed = microtime();
-		wp_cache_set( 'last_changed', $last_changed, 'posts' );
-	}
+	$last_changed = last_changed_cache( 'posts' );
 
 	$hash = md5( $page_path . serialize( $post_type ) );
 	$cache_key = "get_page_by_path:$hash:$last_changed";
@@ -4436,11 +4432,7 @@
 
 	// $args can be whatever, only use the args defined in defaults to compute the key.
 	$key = md5( serialize( wp_array_slice_assoc( $r, array_keys( $defaults ) ) ) );
-	$last_changed = wp_cache_get( 'last_changed', 'posts' );
-	if ( ! $last_changed ) {
-		$last_changed = microtime();
-		wp_cache_set( 'last_changed', $last_changed, 'posts' );
-	}
+	$last_changed = last_changed_cache( 'posts' );
 
 	$cache_key = "get_pages:$key:$last_changed";
 	if ( $cache = wp_cache_get( $cache_key, 'posts' ) ) {
