diff --git a/wp-includes/post.php b/wp-includes/post.php
index 98aeef5..8f9d55d 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -4245,6 +4245,18 @@ function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) {
 
 	$post_types = esc_sql( $post_types );
 	$post_type_in_string = "'" . implode( "','", $post_types ) . "'";
+
+	$key          = $parts . ":" . $post_type_in_string;
+	$last_changed = wp_cache_get( 'last_changed', 'posts' );
+	if ( ! $last_changed ) {
+		$last_changed = microtime();
+		wp_cache_set( 'last_changed', $last_changed, 'posts' );
+	}
+	$cache_key = "get_page_by_path:$key:$last_changed";
+	if ( $cache = wp_cache_get( $cache_key, 'posts' ) ) {
+		return get_post( $cache, $output );
+	}
+
 	$sql = "
 		SELECT ID, post_name, post_parent, post_type
 		FROM $wpdb->posts
@@ -4281,7 +4293,7 @@ function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) {
 			}
 		}
 	}
-
+	wp_cache_set( $cache_key, $foundid, 'posts' );
 	if ( $foundid ) {
 		return get_post( $foundid, $output );
 	}
