[wp-trac] [WordPress Trac] #57886: get_post_templates includes results of get_block_templates while caching (WP_Theme)

WordPress Trac noreply at wordpress.org
Fri Apr 28 20:34:30 UTC 2023


#57886: get_post_templates includes results of get_block_templates while caching
(WP_Theme)
----------------------------------------+----------------------------------
 Reporter:  maniu                       |       Owner:  spacedmonkey
     Type:  defect (bug)                |      Status:  assigned
 Priority:  normal                      |   Milestone:  6.3
Component:  Themes                      |     Version:  5.9
 Severity:  minor                       |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:  multisite,
                                        |  performance
----------------------------------------+----------------------------------

Comment (by joemcgill):

 Caching theme templates separate from edited block templates, i.e. the
 result of `get_block_templates()` could make sense as long as we've
 optimized `get_block_templates()` and the logic that adds relevant block
 templates to the theme's post templates here. Otherwise, I think adding a
 site-specific cache for post templates that includes the current site ID
 would be good. Ideally, we'd like to enhance this whole process so that it
 CAN more reliably be cached persistently, but fixing the immediate bug
 described here is more important in the short term, in my opinion.

 @spacedmonkey we could probably do some profiling comparisons here to make
 sure this doesn't cause a performance regression.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57886#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list