[wp-trac] [WordPress Trac] #56990: Render blocking CSS `classic-themes.css` unnecessarily enqueued
WordPress Trac
noreply at wordpress.org
Fri Feb 17 22:08:19 UTC 2023
#56990: Render blocking CSS `classic-themes.css` unnecessarily enqueued
------------------------------------------+-------------------------------
Reporter: adamsilverstein | Owner: flixos90
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.3
Component: Themes | Version: 6.1
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses: css, performance
------------------------------------------+-------------------------------
Changes (by flixos90):
* keywords: has-patch needs-testing => needs-patch needs-unit-tests
* milestone: 6.2 => 6.3
Comment:
I have conducted another performance benchmark for this locally, using
[https://github.com/GoogleChromeLabs/wpp-research/tree/add/benchmark-web-
vitals/cli#benchmark-web-vitals this CLI script] to measure FCP, LCP, and
TTFB. Running locally is better for benchmarks than using WebPageTest (or
generally requests to external sites) due to the higher variance in those
scenarios.
I ran 20 requests each to WP 6.2 Beta 2 with vs without the change from
https://github.com/WordPress/wordpress-develop/pull/4012 applied.
The results were inconclusive, so then I thought it may be useful to add
another metric "LCP - TTFB", essentially compute that for every request
and get the median (which, just to clarify, is not the same as subtracting
median TTFB from median LCP!). This metric is more effective to assess the
performance impact here, since the server response time (TTFB) should be
ignored for this change, as what we are changing affects only client-side
performance, if anything.
The additional metric did nothing but confirm that there is really no
clear benefit from either approach. Sometimes the inline style was faster,
other times the external file. See the data for "LCP - TTFB" below.
1. Comparison (20 requests each): 133ms (inline style) vs 137.5ms
(external stylesheet)
2. Comparison (20 requests each): 134.65ms (inline style) vs 130.65ms
(external stylesheet)
This additional benchmark confirms what was mentioned above: It doesn't
really make a difference whether we have an inline style or external
stylesheet for this. For that reason, what remains here is a more
appropriate fix, which would be to somehow only load this stylesheet when
at least one of those blocks is used on the page in a classic theme. This
is a whole lot more complex to figure out though (if even reasonably
possible), so I'm removing this from the 6.2 milestone as such a change
would have the chance of introducing other problems, which we are too late
for now.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56990#comment:42>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list