Load templates in a single database query. #45309
Labels
[Feature] Site Editor
Related to the overarching Site Editor (formerly "full site editing")
[Type] Performance
Related to performance efforts
What problem does this address?
Looking looking at stack trace of where database queries comes from, it can be seen that many database
locate_block_template
(get_block_templates
) andrender_block_core_template_part
.Instead of relying on these functions to do a
WP_Query
( and_prime_post_caches
) to a get a single post object of typewp_template
orwp_template_part
, do a single database call, to prime all caches in single database call.What is your proposed solution?
In the post-template block, simple to #40572, loop through nested block, to find all template and template part blocks, get an array and do a single database query to get all template / template parts in a single request.
The text was updated successfully, but these errors were encountered: