Skip to content

Commit e7fa52b

Browse files
committed
Adjust preload paths
1 parent 0d09f16 commit e7fa52b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/wp-admin/site-editor.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static function ( $classes ) {
182182
array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ),
183183
array( rest_get_route_for_post_type_items( 'page' ), 'OPTIONS' ),
184184
'/wp/v2/types?context=view',
185-
'/wp/v2/_wp_static_template?context=edit',
185+
'/wp/v2/wp_registered_template?context=edit',
186186
'/wp/v2/types/wp_template?context=edit',
187187
'/wp/v2/types/wp_template_part?context=edit',
188188
'/wp/v2/templates?context=edit&per_page=-1',
@@ -245,7 +245,9 @@ static function ( $classes ) {
245245
);
246246
}
247247
}
248-
} else {
248+
} else if ( isset( $_GET['p'] ) && '/' !== $_GET['p'] ) {
249+
// Only prefetch for the root. If we preload it for all pages and it's not
250+
// used it won't be possible to invalidate.
249251
$preload_paths[] = '/wp/v2/templates/lookup?slug=front-page';
250252
$preload_paths[] = '/wp/v2/templates/lookup?slug=home';
251253
}

0 commit comments

Comments
 (0)