Index: src/wp-admin/includes/upgrade.php
===================================================================
--- src/wp-admin/includes/upgrade.php	(revision 37872)
+++ src/wp-admin/includes/upgrade.php	(working copy)
@@ -1701,6 +1701,7 @@
  */
 function upgrade_460() {
 	delete_post_meta_by_key( '_post_restored_from' );
+	wp_cache_set( 'last_changed', microtime(), 'terms' );
 }
 
 /**
Index: src/wp-includes/class-wp-term-query.php
===================================================================
--- src/wp-includes/class-wp-term-query.php	(revision 37872)
+++ src/wp-includes/class-wp-term-query.php	(working copy)
@@ -633,7 +633,8 @@
 		$cache_key = "get_terms:$key:$last_changed";
 		$cache = wp_cache_get( $cache_key, 'terms' );
 		if ( false !== $cache ) {
-			if ( 'all' === $_fields ) {
+			if ( 'all' === $_fields ){
+				_prime_term_caches( $cache, $args['update_term_meta_cache'] );
 				$cache = array_map( 'get_term', $cache );
 			}
 
@@ -732,12 +733,19 @@
 			}
 		}
 
-		wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );
 
 		if ( 'all' === $_fields ) {
 			$terms = array_map( 'get_term', $terms );
 		}
 
+		if ( 'all' === $_fields ) {
+			$terms    = array_map( 'get_term', $terms );
+			$term_ids = wp_list_pluck( $terms, 'term_id' );
+			wp_cache_add( $cache_key, $term_ids, 'terms', DAY_IN_SECONDS );
+		} else {
+			wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );
+		}
+
 		$this->terms = $terms;
 		return $this->terms;
 	}
