[wp-trac] [WordPress Trac] #61679: Reimplement caching in `wp_add_global_styles_for_blocks()`

WordPress Trac noreply at wordpress.org
Wed Jul 17 15:01:25 UTC 2024


#61679: Reimplement caching in `wp_add_global_styles_for_blocks()`
--------------------------+-----------------------
 Reporter:  joemcgill     |      Owner:  joemcgill
     Type:  defect (bug)  |     Status:  assigned
 Priority:  normal        |  Milestone:  6.7
Component:  Editor        |    Version:
 Severity:  normal        |   Keywords:  has-patch
  Focuses:  performance   |
--------------------------+-----------------------
 This is a follow-up ticket to #59595 to update and reimplement the caching
 strategy that was reverted in [58710], while leaving that ticket open to
 refocus on the performance of the
 `WP_Theme_JSON::compute_style_properties` method specifically.

 == Background

 While trying to reduce the performance impact of
 `WP_Theme_JSON::compute_style_properties` in #59595, we discovered that
 the reason this was being called so frequently was due to it's use in
 `WP_Theme_JSON::get_styles_for_block()` which is called for each block in
 `wp_add_global_styles_for_blocks()`. See
 [https://core.trac.wordpress.org/ticket/59595#comment:31 this comment].

 [https://core.trac.wordpress.org/ticket/59595#comment:71 This user-facing
 bug] with the site editor was discovered late in the 6.6 cycle, which led
 to the caching being reverted.

 This new ticket is to separate discussion about the reimplementation of
 that cache from additional performance optimizations being worked on
 specific to the original `WP_Theme_JSON::compute_style_properties` method.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61679>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list