Drupal now sets a content-length header for all non-streamed responses (that is, not including pages served with BigPipe replacements).
If any adjustments are made to the response by an http_middleware service, those services may want to re-calculate the content length. This is needed for any service which runs after the http_middleware.content_length service.
If the size is not recalculated, then the response will get truncated by some web server implementations, e.g. nginx does not like a size mismatch.
This enables services implementing DestructableInterface to actually run after delivering the page contents to the client, which was advertised but not effective in practice. Some sites may also need to enable output buffering by default in their PHP configuration to unlock this functionality.
Comments
Breaks New Relic Auto instrumentation
Just cross posting that this update breaks the New Relic PHP agent's Javascript auto-instrumentation. See https://www.drupal.org/project/new_relic_rpm/issues/3444218 and
https://acquia.my.site.com/s/article/New-Relic-Drupal-10-2