Make WordPress Core

Changeset 61117

Timestamp:
11/03/2025 09:55:08 PM (3 weeks ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r61076 r61117  
    30563056    global $wp_styles;
    30573057
    3058     $total_inline_limit = 50000;
     3058    $total_inline_limit = 40000;
    30593059    /**
    30603060     * The maximum size of inlined styles in bytes.
    30613061     *
    30623062     * @since 5.8.0
    3063      * @since 6.9.0 The default limit increased from 20K to 50K.
    3064      *
    3065      * @param int $total_inline_limit The file-size threshold, in bytes. Default 50000.
     3063     * @since 6.9.0 The default limit increased from 20K to 40K.
     3064     *
     3065     * @param int $total_inline_limit The file-size threshold, in bytes. Default 40000.
    30663066     */
    30673067    $total_inline_limit = apply_filters( 'styles_inline_size_limit', $total_inline_limit );
Note: See TracChangeset for help on using the changeset viewer.