[wp-trac] [WordPress Trac] #59595: Improve performance of WP_Theme_JSON::compute_style_properties

WordPress Trac noreply at wordpress.org
Mon Jun 17 14:03:00 UTC 2024


#59595: Improve performance of WP_Theme_JSON::compute_style_properties
-----------------------------------------+--------------------------
 Reporter:  spacedmonkey                 |       Owner:  thekt12
     Type:  enhancement                  |      Status:  reopened
 Priority:  normal                       |   Milestone:  6.6
Component:  Editor                       |     Version:  5.8
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch changes-requested  |     Focuses:  performance
-----------------------------------------+--------------------------
Changes (by joemcgill):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 [58334] uses a transient with a 1 hour TTL to cache global styles for
 blocks to avoid the costly calculation of styles for registered blocks.
 However, the transient expiration time results in an extra DB query being
 made on each request since transients with expiration do not get
 autoloaded, which mostly negates the performance benefit of the cache. I'm
 reopening to see if we can avoid this extra query.

 The approach already uses a hash of the global settings and block nodes as
 part of the cache key, so it's possible that we could just use that hash
 for cache invalidation and bust cache whenever the hash misses rather than
 needing a TTL.

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


More information about the wp-trac mailing list