Index: src/wp-includes/post.php
===================================================================
--- src/wp-includes/post.php	(revision 37433)
+++ src/wp-includes/post.php	(working copy)
@@ -4241,13 +4241,25 @@
 	$in_string = "'" . implode( "','", $parts ) . "'";
 
 	if ( is_array( $post_type ) ) {
+		$last_changed = wp_cache_get( 'last_changed', 'posts' );
+		if ( ! $last_changed ) {
+			$last_changed = microtime();
+			wp_cache_set( 'last_changed', $last_changed, 'posts' );
+		}
+		$cache_key  = md5( serialize( $post_type ) ) . ':' . sanitize_key( $page_path ) . ':' . $last_changed;
 		$post_types = $post_type;
 	} else {
 		$post_types = array( $post_type, 'attachment' );
+		$cache_key  = $post_type . ':' . sanitize_key( $page_path );
 	}
 
+	if ( $cache = wp_cache_get( $cache_key, 'get_page_by_path' ) ) {
+           return get_post( $cache, $output );
+	}
+
 	$post_types = esc_sql( $post_types );
 	$post_type_in_string = "'" . implode( "','", $post_types ) . "'";
+
 	$sql = "
 		SELECT ID, post_name, post_parent, post_type
 		FROM $wpdb->posts
@@ -4284,6 +4296,8 @@
 			}
 		}
 	}
+    
+	wp_cache_set( $cache_key, $foundid, 'posts' ); 
 
 	if ( $foundid ) {
 		return get_post( $foundid, $output );
@@ -5654,6 +5668,9 @@
 
 	wp_cache_delete( 'wp_get_archives', 'general' );
 
+	$page_path = get_page_uri( $post->ID );
+	wp_cache_delete( $post->post_type . ':' . sanitize_key( $page_path ), 'get_page_by_path' );
+
 	/**
 	 * Fires immediately after the given post's cache is cleaned.
 	 *
Index: tests/phpunit/tests/post.php
===================================================================
--- tests/phpunit/tests/post.php	(revision 37433)
+++ tests/phpunit/tests/post.php	(working copy)
@@ -565,6 +565,37 @@
 		$this->assertEquals( $other_att, get_page_by_path( 'some-other-page' ) );
 	}
 
+
+	/**
+	 * @ticket 36711
+	 */
+	function test_get_page_by_path_cache() {
+		global $wpdb;
+
+		$page       = self::factory()->post->create_and_get( array( 'post_title' => 'some-page', 'post_type' => 'page' ) );
+		$wpdb->update( $wpdb->posts, array( 'post_name' => 'some-page' ), array( 'ID' => $page->ID ) );
+		clean_post_cache( $page->ID );
+
+		$page = get_post( $page->ID );
+
+		$this->assertEquals( 'some-page', $page->post_name );
+		$this->assertEquals( $page, get_page_by_path( 'some-page' ) );
+
+		$wpdb->update( $wpdb->posts, array( 'post_name' => 'another-url' ), array( 'ID' => $page->ID ) );
+		clean_post_cache( $page->ID );
+
+		$page = get_post( $page->ID );
+		// Test changing url
+		$this->assertEquals( 'another-url', $page->post_name );
+		$this->assertEquals( $page, get_page_by_path( 'another-url' ) );
+
+		$num_queries = $wpdb->num_queries;
+		$this->assertEquals( $page, get_page_by_path( 'another-url' ) );
+		// Test caching
+		$this->assertEquals( $num_queries, $wpdb->num_queries ); 
+
+	}
+
 	function test_wp_publish_post() {
 		$draft_id = self::factory()->post->create( array( 'post_status' => 'draft' ) );
 
