Skip to content

Conversation

@westonruter
Copy link
Collaborator

@westonruter westonruter commented Oct 21, 2025

This facilitates testing the CWV metrics for repeated page views when assets (e.g. stylesheets, scripts, images) have been cached in the browser. This is to obtain the data needed to implement Core-63018: Increase styles_inline_size_limit from 20,000 bytes.

Example usage:

#!/bin/bash

set -e
echo 'styles_inline_size_limit, uncached, cached' > results.csv

number=10
device="Moto G4"
network="Fast 4G"
for styles_inline_size_limit in $(seq 0 10000 100000); do
	echo "styles_inline_size_limit=$styles_inline_size_limit"
	echo -n $styles_inline_size_limit >> results.csv
	echo -n ', ' >> results.csv
	url="http://localhost:8000/2025/10/20/post-with-many-block-types/?active_plugins=increase-styles-inline-size-limit.php&switched_off=true&script_debug=0&styles_inline_size_limit=$styles_inline_size_limit"
	npm --silent run research -- benchmark-web-vitals --url="$url" --number="$number" --network-conditions="$network" --emulate-device="$device" --output=csv | grep "LCP-TTFB" | cut -d ',' -f 2 | tr -d '\n' >> results.csv
	echo -n ', ' >> results.csv
	npm --silent run research -- benchmark-web-vitals --url="$url" --number="$number" --network-conditions="$network" --emulate-device="$device" --output=csv --enable-cache | grep "LCP-TTFB" | cut -d ',' -f 2 | tr -d '\n' >> results.csv
	echo >> results.csv
done

Query parameters enable increase-styles-inline-size-limit.php plugin via the active-plugins-override.php mu-plugin.

The wp-config.php also has:

define( 'SCRIPT_DEBUG', isset( $_GET['script_debug'] ) ? (int) $_GET['script_debug'] : true );

The page looks like this:

localhost_8000_2025_10_20_post-with-many-block-types__active_plugins=gutenberg(Moto G4)

There is 87,650 bytes of inlinable CSS on the page. When it is all inlined, then there are zero render-blocking stylesheets present.

post_content
<!-- wp:paragraph -->
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut rhoncus pulvinar lacus, quis dignissim urna. Phasellus ultricies sem neque, non elementum velit lobortis a. Maecenas dignissim a dui eget porttitor. Mauris luctus bibendum metus non convallis. Nullam eget velit mollis, vehicula turpis et, molestie dolor. Quisque sollicitudin, felis ut tristique vulputate, orci libero tempus quam, sed malesuada tellus magna ac ipsum. Nulla eleifend risus non turpis elementum, sit amet rhoncus ligula aliquet. Ut ut nibh sed velit tristique eleifend. Vestibulum a lacus arcu.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Nullam rhoncus laoreet urna a pulvinar. Aliquam commodo diam ac enim pretium malesuada. Maecenas urna lectus, scelerisque non consequat ut, cursus vel dolor. Donec lacinia, urna ut feugiat ultrices, libero urna pharetra erat, iaculis iaculis odio nulla vel risus. Vestibulum lacus purus, pulvinar in sollicitudin non, lobortis at risus. Nam pellentesque urna in orci mollis, a ornare massa auctor. Mauris tempor vulputate finibus.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Donec quis bibendum felis. Praesent eget lobortis leo, sollicitudin egestas urna. Etiam dictum risus at velit bibendum, in pellentesque nunc lobortis. Aliquam id ligula non massa lobortis tincidunt quis a lectus. Aenean volutpat nec libero facilisis varius. Maecenas eu est a quam tincidunt auctor id in urna. Nullam rutrum, tortor nec pellentesque tincidunt, enim nisl rhoncus quam, ut convallis nisl lacus vel mauris. Nunc mollis euismod mauris sit amet bibendum. Pellentesque vestibulum mauris ut orci placerat euismod. Nulla congue arcu tempor, consectetur metus sit amet, cursus nisl.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Duis scelerisque orci eget enim mollis bibendum. Nam at porta velit. Nam ac risus accumsan, aliquet tortor venenatis, suscipit velit. Maecenas ac tempor enim. Donec eget massa bibendum, tincidunt lorem eget, dictum felis. Nunc lacinia dolor sed ultricies varius. Duis pharetra interdum purus nec euismod. Aenean tristique viverra leo quis finibus. Nam egestas augue dui, sit amet aliquam risus pharetra vitae. Pellentesque vitae elit sed erat gravida auctor. Vivamus congue id nibh vel sagittis. Donec non odio sit amet elit molestie euismod ac ac orci.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Praesent vitae elementum arcu. Aenean id faucibus neque. Nunc eleifend enim id enim porttitor viverra. Duis convallis nec mauris eu commodo. Ut eleifend eu metus ut tristique. Proin tristique risus eu erat fermentum, ac tristique lacus sagittis. Nullam eget lacus pellentesque, varius justo sit amet, ullamcorper diam. Nulla facilisi. Nunc eget nulla sapien. Phasellus cursus placerat magna, eget rutrum tellus lacinia eu. Morbi cursus tristique nunc id ullamcorper.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Heading</h2>
<!-- /wp:heading -->

<!-- wp:image {"id":556,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="http://localhost:8000/wp-content/uploads/2025/06/American_bison_k5680-1-squooshed-1024x668.jpg" alt="" class="wp-image-556"/></figure>
<!-- /wp:image -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>Item 1</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Item 2</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Item 3</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><!-- wp:paragraph -->
<p>Quote</p>
<!-- /wp:paragraph --></blockquote>
<!-- /wp:quote -->

<!-- wp:code -->
<pre class="wp-block-code"><code>Code</code></pre>
<!-- /wp:code -->

<!-- wp:details -->
<details class="wp-block-details"><summary>Summary</summary><!-- wp:paragraph {"placeholder":"Type / to add a hidden block"} -->
<p>Details</p>
<!-- /wp:paragraph --></details>
<!-- /wp:details -->

<!-- wp:math {"latex":"x^2"} -->
<math class="wp-block-math" display="block"><semantics><msup><mi>x</mi><mn>2</mn></msup><annotation encoding="application/x-tex">x^2</annotation></semantics></math>
<!-- /wp:math -->

<!-- wp:preformatted -->
<pre class="wp-block-preformatted">Preformat</pre>
<!-- /wp:preformatted -->

<!-- wp:pullquote -->
<figure class="wp-block-pullquote"><blockquote><p>Pull quote</p><cite>Citation</cite></blockquote></figure>
<!-- /wp:pullquote -->

<!-- wp:table -->
<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td>x</td><td>y</td></tr><tr><td>a</td><td>b</td></tr></tbody></table></figure>
<!-- /wp:table -->

<!-- wp:verse -->
<pre class="wp-block-verse">Verse 1</pre>
<!-- /wp:verse -->

<!-- wp:gallery {"linkTo":"none"} -->
<figure class="wp-block-gallery has-nested-images columns-default is-cropped"><!-- wp:image {"id":64,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="http://localhost:8000/wp-content/uploads/2025/07/American_Bison_AdF-1024x683.jpg" alt="" class="wp-image-64"/><figcaption class="wp-element-caption">American Bison<br>(Bison bison)<br>A clasic Yellowstone image: bison with a background of yellow fall colour.<br>Yellowstone, Montana, USA</figcaption></figure>
<!-- /wp:image -->

<!-- wp:image {"id":63,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="http://localhost:8000/wp-content/uploads/2025/07/Bison_bison_Wichita_Mountain_Oklahoma-1024x741.jpg" alt="" class="wp-image-63"/></figure>
<!-- /wp:image -->

<!-- wp:image {"id":62,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="http://localhost:8000/wp-content/uploads/2025/07/Juraparc_06-07-2013_-_Buffalo_calf-1024x678.jpg" alt="" class="wp-image-62"/><figcaption class="wp-element-caption">Buffalo calf</figcaption></figure>
<!-- /wp:image --></figure>
<!-- /wp:gallery -->

<!-- wp:cover {"url":"http://localhost:8000/wp-content/uploads/2025/09/Heimdall-PXL_20250919_195438368.MP-1200px-771x1024.jpg","id":437,"dimRatio":50,"customOverlayColor":"#968982","isUserOverlayColor":false,"isDark":false,"sizeSlug":"large","layout":{"type":"constrained"}} -->
<div class="wp-block-cover is-light"><img class="wp-block-cover__image-background wp-image-437 size-large" alt="" src="http://localhost:8000/wp-content/uploads/2025/09/Heimdall-PXL_20250919_195438368.MP-1200px-771x1024.jpg" data-object-fit="cover"/><span aria-hidden="true" class="wp-block-cover__background has-background-dim" style="background-color:#968982"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
<p class="has-text-align-center has-large-font-size">Cover</p>
<!-- /wp:paragraph --></div></div>
<!-- /wp:cover -->

<!-- wp:file {"id":560,"href":"http://localhost:8000/wp-content/uploads/2025/06/dummy.pdf","displayPreview":true} -->
<div class="wp-block-file"><object class="wp-block-file__embed" data="http://localhost:8000/wp-content/uploads/2025/06/dummy.pdf" type="application/pdf" style="width:100%;height:600px" aria-label="dummy"></object><a id="wp-block-file--media-104fade1-b115-4c74-a4de-61f972c11e66" href="http://localhost:8000/wp-content/uploads/2025/06/dummy.pdf">dummy</a><a href="http://localhost:8000/wp-content/uploads/2025/06/dummy.pdf" class="wp-block-file__button wp-element-button" download aria-describedby="wp-block-file--media-104fade1-b115-4c74-a4de-61f972c11e66">Download</a></div>
<!-- /wp:file -->

<!-- wp:media-text {"mediaId":556,"mediaLink":"http://localhost:8000/2025/06/25/lightbox/american_bison_k5680-1-squooshed/","mediaType":"image"} -->
<div class="wp-block-media-text is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img src="http://localhost:8000/wp-content/uploads/2025/06/American_bison_k5680-1-squooshed-1024x668.jpg" alt="" class="wp-image-556 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"Content…"} -->
<p>Media &amp; text</p>
<!-- /wp:paragraph --></div></div>
<!-- /wp:media-text -->

<!-- wp:video {"id":323} -->
<figure class="wp-block-video"><video controls src="http://localhost:8000/wp-content/uploads/2025/09/Bison_Ride_Video_Ready_.mp4"></video></figure>
<!-- /wp:video -->

<!-- wp:accordion -->
<div role="group" class="wp-block-accordion"><!-- wp:accordion-item -->
<div class="wp-block-accordion-item"><!-- wp:accordion-heading -->
<h3 class="wp-block-accordion-heading"><button class="wp-block-accordion-heading__toggle"><span class="wp-block-accordion-heading__toggle-title">Title</span><span class="wp-block-accordion-heading__toggle-icon" aria-hidden="true">+</span></button></h3>
<!-- /wp:accordion-heading -->

<!-- wp:accordion-panel -->
<div role="region" class="wp-block-accordion-panel"><!-- wp:paragraph -->
<p>Content</p>
<!-- /wp:paragraph --></div>
<!-- /wp:accordion-panel --></div>
<!-- /wp:accordion-item --></div>
<!-- /wp:accordion -->

<!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="/">Button</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:paragraph -->
<p>1</p>
<!-- /wp:paragraph --></div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column"><!-- wp:paragraph -->
<p>2</p>
<!-- /wp:paragraph --></div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column"><!-- wp:paragraph -->
<p>3</p>
<!-- /wp:paragraph --></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->

<!-- wp:group {"style":{"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"backgroundColor":"accent-1","textColor":"contrast","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-contrast-color has-accent-1-background-color has-text-color has-background has-link-color"><!-- wp:paragraph -->
<p>Group</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:separator -->
<hr class="wp-block-separator has-alpha-channel-opacity"/>
<!-- /wp:separator -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

Output:

styles_inline_size_limit uncached cached
0 1473.6 129.1
10000 612.0 134.9
20000 563.8 136.7
30000 422.6 147.5
40000 419.0 167.6
50000 414.5 165.4
60000 409.4 179.7
70000 433.1 200.4
80000 434.5 194.8
90000 316.9 217.3
100000 308.5 219.0

Graph:

Median LCP-TTFB for Uncached vs Cached page loads with increasing styles_inline_size_limit

File sizes of minified block styles: https://gist.github.com/westonruter/f781ba5b6c9ac538a43977a8d2879730

@westonruter
Copy link
Collaborator Author

westonruter commented Oct 22, 2025

I wanted to get more resolution in the chart. The initial data I collected had a 10K step for incrementing the styles_inline_size_limit. I revised the benchmark script to change the step to 1K. I also added even more blocks to the test post, so that the total of all inlined CSS would exceed 108KB. The updated benchmark script captures also captures the total amount of inlined CSS on the page in addition to the number of external stylesheets present.

Updated benchmarking script
#!/bin/bash

set -e
echo 'styles_inline_size_limit, uncached, cached, css_inline_bytes, external_stylesheet_links' > results.csv

number=10
step=1000
max=120000
device="Moto G4"
network="Fast 4G"
for styles_inline_size_limit in $(seq 0 $step $max); do
	echo "styles_inline_size_limit=$styles_inline_size_limit"
	echo -n $styles_inline_size_limit >> results.csv
	echo -n ', ' >> results.csv
	url="http://localhost:8000/2025/10/20/post-with-many-block-types/?active_plugins=increase-styles-inline-size-limit.php&switched_off=true&script_debug=0&styles_inline_size_limit=$styles_inline_size_limit"
	time npm --silent run research -- benchmark-web-vitals --url="$url" --number="$number" --network-conditions="$network" --emulate-device="$device" --output=csv | grep "LCP-TTFB" | cut -d ',' -f 2 | tr -d '\n' >> results.csv
	echo -n ', ' >> results.csv
	time npm --silent run research -- benchmark-web-vitals --url="$url" --number="$number" --network-conditions="$network" --emulate-device="$device" --output=csv --enable-cache | grep "LCP-TTFB" | cut -d ',' -f 2 | tr -d '\n' >> results.csv
	echo -n ', ' >> results.csv
	curl $url > /tmp/page.html
	xmllint --html --xpath '//style/text()' /tmp/page.html 2>/dev/null | sed ':a;N;$!ba; s/<!\[CDATA\[\n//g; s/\s\]\]>//g' | wc -c | tr -d ' \n' >> results.csv
	echo -n ', ' >> results.csv
	xmllint --html --xpath 'count(//link[@rel="stylesheet"])' /tmp/page.html 2>/dev/null | tr -d '\n' >> results.csv
	echo >> results.csv
done

Chart with additional resolution:

Median LCP-TTFB for Uncached vs Cached page loads with increasing styles_inline_size_limit step by 1KB
Raw data
styles_inline_size_limit uncached cached css_inline_bytes external_stylesheet_links
0 1697.8 122.6 27,079 48
1000 1366.2 124.4 28,925 36
2000 1262.9 118.2 30,101 32
3000 1110.0 126.9 31,363 29
4000 1108.9 125.9 32,437 27
5000 1112.3 127.1 33,738 25
6000 992.1 127.3 34,470 24
7000 933.0 131.7 35,956 22
8000 924.8 134.1 36,699 21
9000 931.3 138.2 38,378 19
10000 848.1 140.7 39,474 18
11000 852.4 139.4 39,474 18
12000 807.0 142.8 40,675 17
13000 796.4 137.6 42,066 16
14000 788.5 146.0 43,542 15
15000 792.8 142.8 43,542 15
16000 759.5 147.3 45,150 14
17000 760.5 142.2 46,815 13
18000 752.1 149.4 46,815 13
19000 661.3 150.8 48,738 12
20000 661.3 148.3 48,738 12
21000 613.1 149.5 50,821 11
22000 622.5 142.0 50,821 11
23000 619.1 148.9 53,143 10
24000 615.1 149.3 53,143 10
25000 619.1 160.7 53,143 10
26000 610.7 164.0 55,592 9
27000 615.0 161.0 55,592 9
28000 585.4 161.5 58,061 8
29000 591.6 159.6 58,061 8
30000 585.0 160.6 58,061 8
31000 571.8 167.7 60,754 7
32000 569.4 165.3 60,754 7
33000 571.7 169.9 60,754 7
34000 505.7 170.9 64,328 6
35000 500.7 173.3 64,328 6
36000 508.7 167.6 64,328 6
37000 504.7 168.9 64,328 6
38000 445.2 175.2 68,295 5
39000 445.7 171.1 68,295 5
40000 438.4 177.4 68,295 5
41000 438.1 175.3 68,295 5
42000 445.8 173.3 68,295 5
43000 446.6 172.6 68,295 5
44000 446.4 170.3 68,295 5
45000 438.4 177.7 75,120 4
46000 440.4 178.5 75,120 4
47000 435.0 176.1 75,120 4
48000 434.2 173.9 75,120 4
49000 435.2 178.5 75,120 4
50000 437.8 181.0 75,120 4
51000 436.3 176.9 75,120 4
52000 436.6 181.5 75,120 4
53000 436.2 178.6 75,120 4
54000 439.2 176.8 75,120 4
55000 443.9 179.6 75,120 4
56000 433.3 178.1 75,120 4
57000 422.4 187.4 86,968 3
58000 426.9 191.1 86,968 3
59000 429.5 194.5 86,968 3
60000 425.1 194.0 86,968 3
61000 429.3 194.3 86,968 3
62000 423.1 193.3 86,968 3
63000 420.2 195.4 86,968 3
64000 429.0 194.1 86,968 3
65000 416.5 189.3 86,968 3
66000 423.7 187.2 86,968 3
67000 427.3 186.6 86,968 3
68000 424.1 191.4 86,968 3
69000 421.8 195.9 86,968 3
70000 426.9 196.0 86,968 3
71000 429.2 196.0 86,968 3
72000 426.0 194.2 86,968 3
73000 415.2 215.9 103,169 2
74000 414.5 216.1 103,169 2
75000 427.3 214.6 103,169 2
76000 415.6 209.7 103,169 2
77000 411.8 213.0 103,169 2
78000 420.5 217.2 103,169 2
79000 414.7 214.3 103,169 2
80000 419.3 212.2 103,169 2
81000 420.4 206.3 103,169 2
82000 416.8 215.7 103,169 2
83000 416.3 213.5 103,169 2
84000 412.9 212.4 103,169 2
85000 413.7 212.4 103,169 2
86000 411.0 206.9 103,169 2
87000 417.0 216.4 103,169 2
88000 411.8 211.3 103,169 2
89000 417.1 208.4 103,169 2
90000 444.9 230.0 120,132 1
91000 441.6 239.8 120,132 1
92000 439.5 230.4 120,132 1
93000 439.1 234.4 120,132 1
94000 445.1 233.1 120,132 1
95000 446.8 235.6 120,132 1
96000 439.8 239.6 120,132 1
97000 441.7 234.4 120,132 1
98000 443.2 237.5 120,132 1
99000 440.3 233.2 120,132 1
100000 441.5 234.2 120,132 1
101000 441.1 236.9 120,132 1
102000 441.9 229.0 120,132 1
103000 441.8 235.0 120,132 1
104000 439.9 234.6 120,132 1
105000 449.0 235.1 120,132 1
106000 439.6 231.3 120,132 1
107000 441.1 233.7 120,132 1
108000 445.4 234.4 120,132 1
109000 349.9 261.0 139,337 0
110000 349.3 256.1 139,337 0
111000 351.2 256.1 139,337 0
112000 339.8 260.1 139,337 0
113000 351.5 255.9 139,337 0
114000 350.1 254.1 139,337 0
115000 351.5 261.5 139,337 0
116000 345.0 258.3 139,337 0
117000 347.8 257.6 139,337 0
118000 344.6 254.2 139,337 0
119000 345.0 255.6 139,337 0
120000 348.6 255.2 139,337 0

@westonruter
Copy link
Collaborator Author

I did the above test in the wordpress-develop environment and I just realized that while static assets were being served with Last-Modified response headers, the browser was still having to do conditional requests with If-Modified-Since in which case the server could return a 304 Not Modified response. In a production environment, such conditional requests wouldn't be needed since they should be served with far-future expiration. I applied this patch to the web server:

diff --git a/tools/local-env/default.template b/tools/local-env/default.template
index 995913fb45..ecce8ea780 100644
--- a/tools/local-env/default.template
+++ b/tools/local-env/default.template
@@ -25,6 +25,11 @@ server {
 		try_files $uri $uri/ /index.php?$args;
 	}
 
+	location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
+		expires 1y;
+		add_header Cache-Control "public, no-transform";
+	}
+
 	location ~ \.php$ {
 		try_files $uri =404;
 		fastcgi_split_path_info ^(.+\.php)(/.+)$;

Now static assets return with:

Expires: Mon, 26 Oct 2026 03:41:48 GMT
Cache-Control: max-age=31536000
Cache-Control: public, no-transform

Fortunately, I re-ran the tests and found a negligible different in the cached results:

increasing-css-inline-size-limit
Raw Data
styles_inline_size_limit uncached cached css_inline_bytes external_stylesheet_links
0 1704.6 123.4 27079 48
1000 1345.6 129.1 28925 36
2000 1276.5 130.5 30101 32
3000 1128.7 129.6 31363 29
4000 1108.0 129.6 32437 27
5000 1104.7 122.7 33738 25
6000 1000.2 133.2 34470 24
7000 938.0 127.6 35956 22
8000 930.0 134.3 36699 21
9000 929.2 127.3 38378 19
10000 833.5 138.3 39474 18
11000 838.2 133.6 39474 18
12000 802.2 131.3 40675 17
13000 796.2 141.4 42066 16
14000 795.5 134.3 43542 15
15000 787.5 136.6 43542 15
16000 754.7 141.3 45150 14
17000 749.5 146.2 46815 13
18000 750.5 141.7 46815 13
19000 658.6 145.5 48738 12
20000 655.7 141.3 48738 12
21000 606.6 145.2 50821 11
22000 613.5 146.6 50821 11
23000 602.6 144.9 53143 10
24000 608.8 154.6 53143 10
25000 611.9 146.2 53143 10
26000 605.7 153.5 55592 9
27000 607.7 156.4 55592 9
28000 577.0 153.3 58061 8
29000 583.8 154.9 58061 8
30000 579.5 153.7 58061 8
31000 568.1 161.8 60754 7
32000 570.5 159.7 60754 7
33000 569.6 154.7 60754 7
34000 502.0 161.4 64328 6
35000 517.7 170.1 64328 6
36000 520.3 166.6 64328 6
37000 526.0 162.2 64328 6
38000 444.3 177.1 68295 5
39000 446.4 172.0 68295 5
40000 449.9 171.6 68295 5
41000 452.5 179.2 68295 5
42000 444.1 172.6 68295 5
43000 451.5 171.8 68295 5
44000 448.9 173.8 68295 5
45000 442.7 177.6 75120 4
46000 433.9 179.9 75120 4
47000 429.9 176.2 75120 4
48000 423.9 178.6 75120 4
49000 431.4 179.5 75120 4
50000 430.2 179.2 75120 4
51000 435.6 177.6 75120 4
52000 432.3 179.0 75120 4
53000 438.6 175.7 75120 4
54000 437.8 167.6 75120 4
55000 428.8 180.5 75120 4
56000 434.2 176.5 75120 4
57000 416.9 195.5 86968 3
58000 417.7 190.2 86968 3
59000 421.4 196.6 86968 3
60000 414.9 191.8 86968 3
61000 418.9 187.3 86968 3
62000 419.0 188.8 86968 3
63000 422.1 188.9 86968 3
64000 422.6 193.8 86968 3
65000 419.8 192.3 86968 3
66000 420.8 188.7 86968 3
67000 420.4 196.8 86968 3
68000 422.6 195.3 86968 3
69000 426.8 183.3 86968 3
70000 426.9 196.7 86968 3
71000 423.7 186.7 86968 3
72000 420.1 190.3 86968 3
73000 416.5 209.5 103169 2
74000 417.4 211.3 103169 2
75000 416.0 211.6 103169 2
76000 411.3 205.4 103169 2
77000 414.3 210.1 103169 2
78000 412.1 212.4 103169 2
79000 420.3 209.9 103169 2
80000 416.1 208.3 103169 2
81000 419.0 211.2 103169 2
82000 417.1 209.7 103169 2
83000 411.4 202.2 103169 2
84000 410.9 205.5 103169 2
85000 407.9 206.3 103169 2
86000 416.6 208.8 103169 2
87000 413.2 206.6 103169 2
88000 419.0 206.6 103169 2
89000 418.7 206.0 103169 2
90000 435.0 222.4 120132 1
91000 434.5 222.2 120132 1
92000 421.0 213.5 120132 1
93000 425.6 224.4 120132 1
94000 438.3 219.6 120132 1
95000 434.5 230.3 120132 1
96000 436.9 227.7 120132 1
97000 436.4 226.4 120132 1
98000 436.1 230.3 120132 1
99000 434.1 227.1 120132 1
100000 431.8 228.6 120132 1
101000 436.3 227.4 120132 1
102000 434.5 229.2 120132 1
103000 430.6 233.8 120132 1
104000 436.8 230.6 120132 1
105000 434.3 227.0 120132 1
106000 434.7 233.6 120132 1
107000 432.7 227.4 120132 1
108000 434.8 219.9 120132 1
109000 343.5 257.1 139337 0
110000 344.3 250.9 139337 0
111000 340.3 255.6 139337 0
112000 338.1 235.9 139337 0
113000 343.9 250.3 139337 0
114000 336.1 246.7 139337 0
115000 339.3 253.0 139337 0
116000 341.3 254.9 139337 0
117000 342.5 252.6 139337 0
118000 343.5 254.0 139337 0
119000 340.0 246.5 139337 0
120000 345.9 250.1 139337 0

@westonruter
Copy link
Collaborator Author

westonruter commented Oct 26, 2025

For completeness, I've also done the benchmarking with broadband.

Benchmarking Script
#!/bin/bash

set -e
echo 'styles_inline_size_limit, uncached, cached, css_inline_bytes, external_stylesheet_links' > results.csv

number=10
step=1000
max=120000
device="Moto G4"
network="broadband"
for styles_inline_size_limit in $(seq 0 $step $max); do
	echo "styles_inline_size_limit=$styles_inline_size_limit"
	echo -n $styles_inline_size_limit >> results.csv
	echo -n ', ' >> results.csv
	url="http://localhost:8000/2025/10/20/post-with-many-block-types/?active_plugins=increase-styles-inline-size-limit.php&switched_off=true&script_debug=0&styles_inline_size_limit=$styles_inline_size_limit"
	time npm --silent run research -- benchmark-web-vitals --url="$url" --number="$number" --network-conditions="$network" --emulate-device="$device" --output=csv | grep "LCP-TTFB" | cut -d ',' -f 2 | tr -d '\n' >> results.csv
	echo -n ', ' >> results.csv
	time npm --silent run research -- benchmark-web-vitals --url="$url" --number="$number" --network-conditions="$network" --emulate-device="$device" --output=csv --enable-cache | grep "LCP-TTFB" | cut -d ',' -f 2 | tr -d '\n' >> results.csv
	echo -n ', ' >> results.csv
	curl $url > /tmp/page.html
	xmllint --html --xpath '//style/text()' /tmp/page.html 2>/dev/null | sed ':a;N;$!ba; s/<!\[CDATA\[\n//g; s/\s\]\]>//g' | wc -c | tr -d ' \n' >> results.csv
	echo -n ', ' >> results.csv
	xmllint --html --xpath 'count(//link[@rel="stylesheet"])' /tmp/page.html 2>/dev/null | tr -d '\n' >> results.csv
	echo >> results.csv
done
increasing-css-inline-size-limit-broadband

👉🏻 For broadband as well as with Fast 4G, increasing the styles_inline_size_limit results in a exponential decay (diminishing returns) in the performance improvement for uncached visits whereas for cached visits there is a linear performance degradation.

Raw Results
styles_inline_size_limit uncached cached css_inline_bytes external_stylesheet_links
0 626.8 81.8 27079 48
1000 517.9 76.6 28925 36
2000 472.5 80.6 30101 32
3000 454.3 83.5 31363 29
4000 450.9 83.7 32437 27
5000 428.4 79.2 33738 25
6000 411.7 85.6 34470 24
7000 396.7 82.1 35956 22
8000 403.4 85.8 36699 21
9000 388.9 82.4 38378 19
10000 387.0 85.1 39474 18
11000 387.7 88.5 39474 18
12000 376.8 87.0 40675 17
13000 374.6 86.1 42066 16
14000 379.9 89.4 43542 15
15000 374.6 89.8 43542 15
16000 368.3 88.9 45150 14
17000 342.8 94.8 46815 13
18000 344.0 93.7 46815 13
19000 332.6 98.1 48738 12
20000 337.1 96.0 48738 12
21000 325.6 97.7 50821 11
22000 332.6 98.6 50821 11
23000 314.5 100.1 53143 10
24000 314.5 100.2 53143 10
25000 314.3 96.8 53143 10
26000 317.8 98.0 55592 9
27000 309.0 97.5 55592 9
28000 317.4 101.5 58061 8
29000 315.4 104.8 58061 8
30000 313.2 103.8 58061 8
31000 285.1 102.5 60754 7
32000 286.6 105.6 60754 7
33000 288.1 99.3 60754 7
34000 283.3 108.3 64328 6
35000 285.3 106.5 64328 6
36000 290.2 106.4 64328 6
37000 283.2 112.2 64328 6
38000 264.7 111.8 68295 5
39000 269.0 112.8 68295 5
40000 269.6 109.6 68295 5
41000 269.8 111.8 68295 5
42000 267.2 113.6 68295 5
43000 265.5 112.5 68295 5
44000 272.5 112.6 68295 5
45000 263.1 114.1 75120 4
46000 266.9 117.6 75120 4
47000 269.5 117.2 75120 4
48000 266.5 114.6 75120 4
49000 263.0 116.1 75120 4
50000 263.2 116.4 75120 4
51000 266.3 115.7 75120 4
52000 264.8 116.1 75120 4
53000 260.7 120.1 75120 4
54000 264.5 115.5 75120 4
55000 270.3 112.3 75120 4
56000 263.1 117.0 75120 4
57000 258.3 123.6 86968 3
58000 261.0 129.6 86968 3
59000 257.5 128.8 86968 3
60000 262.2 126.0 86968 3
61000 258.2 128.2 86968 3
62000 261.0 126.7 86968 3
63000 260.5 129.6 86968 3
64000 260.9 129.2 86968 3
65000 260.9 127.5 86968 3
66000 268.1 131.7 86968 3
67000 263.4 129.8 86968 3
68000 266.3 130.0 86968 3
69000 262.0 128.3 86968 3
70000 261.8 130.9 86968 3
71000 255.7 129.2 86968 3
72000 262.3 131.1 86968 3
73000 265.5 145.3 103169 2
74000 269.4 146.0 103169 2
75000 267.3 151.5 103169 2
76000 266.8 148.8 103169 2
77000 268.0 145.6 103169 2
78000 265.0 145.4 103169 2
79000 267.9 146.1 103169 2
80000 265.9 144.5 103169 2
81000 262.1 146.2 103169 2
82000 270.7 140.0 103169 2
83000 262.4 140.8 103169 2
84000 264.8 146.5 103169 2
85000 257.9 147.0 103169 2
86000 263.5 143.4 103169 2
87000 263.5 143.9 103169 2
88000 264.5 146.5 103169 2
89000 260.5 146.8 103169 2
90000 262.6 163.9 120132 1
91000 265.0 162.9 120132 1
92000 264.7 159.6 120132 1
93000 264.6 161.2 120132 1
94000 262.5 160.0 120132 1
95000 270.1 158.5 120132 1
96000 259.5 160.7 120132 1
97000 259.3 162.6 120132 1
98000 264.0 154.6 120132 1
99000 264.8 162.8 120132 1
100000 261.1 159.8 120132 1
101000 262.0 160.4 120132 1
102000 263.6 157.7 120132 1
103000 259.7 160.0 120132 1
104000 262.8 162.9 120132 1
105000 266.4 160.6 120132 1
106000 266.9 163.0 120132 1
107000 262.8 163.9 120132 1
108000 268.6 160.8 120132 1
109000 270.3 187.6 139337 0
110000 268.1 188.5 139337 0
111000 269.4 183.5 139337 0
112000 274.8 185.1 139337 0
113000 271.1 184.5 139337 0
114000 269.5 186.2 139337 0
115000 271.9 180.9 139337 0
116000 266.3 184.6 139337 0
117000 267.6 179.3 139337 0
118000 269.9 181.7 139337 0
119000 270.5 180.1 139337 0
120000 266.1 183.1 139337 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants