Script Loader: Reduce styles_inline_size_limit down to 40K from 50K.

In [61013] the CSS inline limit was increased from 20K to 50K. However, based on benchmarking the performance improvements of increasing the limit, the relative improvement from 40K to 50K is not as great as from 30K to 40K. The performance improvements start to flatten out beginning at 40K. This 40K is still double the previous limit of 20K. Being more conservative will allow for a more gradual impact to be observed before considering a larger increase. Furthermore, the 50K limit of inline CSS can cause the oEmbed discovery links to be positioned after the first 150K bytes which prevents them from being discovered. See #64178.

Follow-up to [61013].

Props westonruter, mukesh27, szepeviktor.
See #64178.
Fixes #63018.

Built from https://develop.svn.wordpress.org/trunk@61117


git-svn-id: http://core.svn.wordpress.org/trunk@60453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter
2025-11-03 21:57:33 +00:00
parent 71dab9f7cf
commit 9f4eb0d284
2 changed files with 4 additions and 4 deletions

View File

@@ -3055,14 +3055,14 @@ function wp_print_inline_script_tag( $data, $attributes = array() ) {
function wp_maybe_inline_styles() {
global $wp_styles;
$total_inline_limit = 50000;
$total_inline_limit = 40000;
/**
* The maximum size of inlined styles in bytes.
*
* @since 5.8.0
* @since 6.9.0 The default limit increased from 20K to 50K.
* @since 6.9.0 The default limit increased from 20K to 40K.
*
* @param int $total_inline_limit The file-size threshold, in bytes. Default 50000.
* @param int $total_inline_limit The file-size threshold, in bytes. Default 40000.
*/
$total_inline_limit = apply_filters( 'styles_inline_size_limit', $total_inline_limit );

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.9-beta2-61116';
$wp_version = '6.9-beta2-61117';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.