diff --git wp-includes/taxonomy.php wp-includes/taxonomy.php
index c2797b0..9d76ca7 100644
--- wp-includes/taxonomy.php
+++ wp-includes/taxonomy.php
@@ -1150,12 +1150,16 @@ function &get_terms($taxonomies, $args = '') {
 	// $args can be whatever, only use the args defined in defaults to compute the key
 	$filter_key = ( has_filter('list_terms_exclusions') ) ? serialize($GLOBALS['wp_filter']['list_terms_exclusions']) : '';
 	$key = md5( serialize( compact(array_keys($defaults)) ) . serialize( $taxonomies ) . $filter_key );
-	$last_changed = wp_cache_get('last_changed', 'terms');
-	if ( !$last_changed ) {
-		$last_changed = time();
-		wp_cache_set('last_changed', $last_changed, 'terms');
+	$cache_key = "get_terms:$key";
+	
+	// save $key so that it could be invalidated later
+	$cache_keys = wp_cache_get( 'get_terms:cache_keys', 'terms' );
+	if ( ! $cache_keys ) {
+		$cache_keys = array();
 	}
-	$cache_key = "get_terms:$key:$last_changed";
+	$cache_keys[$keys] = $taxonomies;
+	wp_cache_set( 'get_terms:cache_keys', $cache_keys, 'terms' );
+
 	$cache = wp_cache_get( $cache_key, 'terms' );
 	if ( false !== $cache ) {
 		$cache = apply_filters('get_terms', $cache, $taxonomies, $args);
@@ -1297,6 +1301,7 @@ function &get_terms($taxonomies, $args = '') {
 
 	if ( 'count' == $fields ) {
 		$term_count = $wpdb->get_var($query);
+		wp_cache_add( $cache_key, $term_count, 'terms' );
 		return $term_count;
 	}
 
@@ -1707,7 +1712,7 @@ function wp_delete_term( $term, $taxonomy, $args = array() ) {
 	if ( !$wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d", $term) ) )
 		$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->terms WHERE term_id = %d", $term) );
 
-	clean_term_cache($term, $taxonomy);
+	clean_term_cache($term, $taxonomy, true, true);
 
 	do_action('delete_term', $term, $tt_id, $taxonomy);
 	do_action("delete_$taxonomy", $term, $tt_id);
@@ -2001,7 +2006,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
 
 	$term_id = apply_filters('term_id_filter', $term_id, $tt_id);
 
-	clean_term_cache($term_id, $taxonomy);
+	clean_term_cache( $term_id, $taxonomy, true, (bool) $parent );
 
 	do_action("created_term", $term_id, $tt_id, $taxonomy);
 	do_action("created_$taxonomy", $term_id, $tt_id);
@@ -2440,8 +2445,10 @@ function clean_object_term_cache($object_ids, $object_type) {
  * @param int|array $ids Single or list of Term IDs
  * @param string $taxonomy Can be empty and will assume tt_ids, else will use for context.
  * @param bool $clean_taxonomy Whether to clean taxonomy wide caches (true), or just individual term object caches (false). Default is true.
+ * @param bool $force_clean_taxonomy Whether to force clean taxonomy wide caches (true), or skip if it's already done (false). Default is false
+ * 
  */
-function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true) {
+function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true, $force_clean_taxonomy = false) {
 	global $wpdb;
 	static $cleaned = array();
 
@@ -2471,13 +2478,28 @@ function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true) {
 	}
 
 	foreach ( $taxonomies as $taxonomy ) {
-		if ( isset($cleaned[$taxonomy]) )
+		if ( isset($cleaned[$taxonomy]) && ! $force_clean_taxonomy )
 			continue;
 		$cleaned[$taxonomy] = true;
 
 		if ( $clean_taxonomy ) {
 			wp_cache_delete('all_ids', $taxonomy);
 			wp_cache_delete('get', $taxonomy);
+			
+			// clear get_terms cache
+			$cache_keys = wp_cache_get( 'get_terms:cache_keys', 'terms' );
+			if ( ! empty( $cache_keys ) ) {
+				foreach ( $cache_keys as $key => $cache_taxonomies ) {
+					if ( in_array( $taxonomy, $cache_taxonomies ) ) {
+						wp_cache_delete( "get_terms:{$key}", 'terms' );
+						unset( $cache_keys[$key] );
+					}
+				}
+			} else {
+				$cache_keys = array();
+			}
+			wp_cache_set( 'get_terms:cache_keys', $cache_keys, 'terms' );
+			
 			delete_option("{$taxonomy}_children");
 			// Regenerate {$taxonomy}_children
 			_get_term_hierarchy($taxonomy);
@@ -2485,8 +2507,6 @@ function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true) {
 
 		do_action('clean_term_cache', $ids, $taxonomy);
 	}
-
-	wp_cache_set('last_changed', time(), 'terms');
 }
 
 
