[wp-trac] [WordPress Trac] #58810: Allow giving priority to a block style for wp_maybe_inline_styles()

WordPress Trac noreply at wordpress.org
Wed Aug 16 18:28:16 UTC 2023


#58810: Allow giving priority to a block style for wp_maybe_inline_styles()
---------------------------+------------------------------
 Reporter:  asafm7         |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  performance
---------------------------+------------------------------

Comment (by westonruter):

 I didn't see this in the description, but the title of this ticket "Allow
 giving priority to a block style for wp_maybe_inline_styles()" seems to
 suggest that there be a way to mark certain stylesheets as being more
 important for inlining than others.

 For block themes, it could actually be possible to do this automatically.
 For example, any stylesheets for blocks located in the header template
 could be automatically prioritized for inlining, even if that causes them
 to go above the `styles_inline_size_limit`. Otherwise, if not
 automatically, there could be some extra flag when registering a block
 that its going to most likely be in the header and thus should have its
 stylesheet prioritized for inlining. But that seems less ideal than doing
 it programmatically.

 Nevertheless, I didn't see any real performance benefit from the inlining.
 I bet that external stylesheets loaded from the same origin as the page
 will not a performance problem compared to stylesheets loaded from an
 external origin (e.g. a CDN), because the open TCP connection to the
 origin should allow the browser to quickly fetch the stylesheet from the
 same origin. This should be further tested. If this is the case, then the
 performance issue in this ticket would be most noticed when a site is
 trying to improve performance when using a CDN, in which case the
 performance would actually be degraded.

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


More information about the wp-trac mailing list