Commit 4fe42d9c authored by Andrew Nacin's avatar Andrew Nacin
Browse files

Revert [27115] and let cache backends handle the stripping of spaces in cache keys as necessary.

microtime() returns greater precision than microtime(true).

see #27000, #23448, #26903, #14485.

Built from https://develop.svn.wordpress.org/trunk@27300


git-svn-id: https://core.svn.wordpress.org/trunk@27153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent a6c3932a
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -280,7 +280,7 @@ class WP_Comment_Query {
		$key = md5( serialize( compact(array_keys($defaults)) )  );
		$key = md5( serialize( compact(array_keys($defaults)) )  );
		$last_changed = wp_cache_get( 'last_changed', 'comment' );
		$last_changed = wp_cache_get( 'last_changed', 'comment' );
		if ( ! $last_changed ) {
		if ( ! $last_changed ) {
			$last_changed = microtime( true );
			$last_changed = microtime();
			wp_cache_set( 'last_changed', $last_changed, 'comment' );
			wp_cache_set( 'last_changed', $last_changed, 'comment' );
		}
		}
		$cache_key = "get_comments:$key:$last_changed";
		$cache_key = "get_comments:$key:$last_changed";
@@ -1563,7 +1563,7 @@ function wp_insert_comment($commentdata) {
	 */
	 */
	do_action( 'wp_insert_comment', $id, $comment );
	do_action( 'wp_insert_comment', $id, $comment );


	wp_cache_set( 'last_changed', microtime( true ), 'comment' );
	wp_cache_set( 'last_changed', microtime(), 'comment' );


	return $id;
	return $id;
}
}
@@ -2361,7 +2361,7 @@ function clean_comment_cache($ids) {
	foreach ( (array) $ids as $id )
	foreach ( (array) $ids as $id )
		wp_cache_delete($id, 'comment');
		wp_cache_delete($id, 'comment');


	wp_cache_set( 'last_changed', microtime( true ), 'comment' );
	wp_cache_set( 'last_changed', microtime(), 'comment' );
}
}


/**
/**
+1 −1
Original line number Original line Diff line number Diff line
@@ -985,7 +985,7 @@ function wp_get_archives($args = '') {


	$last_changed = wp_cache_get( 'last_changed', 'posts' );
	$last_changed = wp_cache_get( 'last_changed', 'posts' );
	if ( ! $last_changed ) {
	if ( ! $last_changed ) {
		$last_changed = microtime( true );
		$last_changed = microtime();
		wp_cache_set( 'last_changed', $last_changed, 'posts' );
		wp_cache_set( 'last_changed', $last_changed, 'posts' );
	}
	}


+2 −2
Original line number Original line Diff line number Diff line
@@ -3733,7 +3733,7 @@ function get_pages( $args = array() ) {
	$key = md5( serialize( compact(array_keys($defaults)) ) );
	$key = md5( serialize( compact(array_keys($defaults)) ) );
	$last_changed = wp_cache_get( 'last_changed', 'posts' );
	$last_changed = wp_cache_get( 'last_changed', 'posts' );
	if ( ! $last_changed ) {
	if ( ! $last_changed ) {
		$last_changed = microtime( true );
		$last_changed = microtime();
		wp_cache_set( 'last_changed', $last_changed, 'posts' );
		wp_cache_set( 'last_changed', $last_changed, 'posts' );
	}
	}


@@ -4754,7 +4754,7 @@ function clean_post_cache( $post ) {
		do_action( 'clean_page_cache', $post->ID );
		do_action( 'clean_page_cache', $post->ID );
	}
	}


	wp_cache_set( 'last_changed', microtime( true ), 'posts' );
	wp_cache_set( 'last_changed', microtime(), 'posts' );
}
}


/**
/**
+2 −2
Original line number Original line Diff line number Diff line
@@ -1287,7 +1287,7 @@ function get_terms($taxonomies, $args = '') {
	$key = md5( serialize( compact(array_keys($defaults)) ) . serialize( $taxonomies ) . $filter_key );
	$key = md5( serialize( compact(array_keys($defaults)) ) . serialize( $taxonomies ) . $filter_key );
	$last_changed = wp_cache_get( 'last_changed', 'terms' );
	$last_changed = wp_cache_get( 'last_changed', 'terms' );
	if ( ! $last_changed ) {
	if ( ! $last_changed ) {
		$last_changed = microtime( true );
		$last_changed = microtime();
		wp_cache_set( 'last_changed', $last_changed, 'terms' );
		wp_cache_set( 'last_changed', $last_changed, 'terms' );
	}
	}
	$cache_key = "get_terms:$key:$last_changed";
	$cache_key = "get_terms:$key:$last_changed";
@@ -2750,7 +2750,7 @@ function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true) {
		do_action('clean_term_cache', $ids, $taxonomy);
		do_action('clean_term_cache', $ids, $taxonomy);
	}
	}


	wp_cache_set( 'last_changed', microtime( true ), 'terms' );
	wp_cache_set( 'last_changed', microtime(), 'terms' );
}
}


/**
/**