Title: In Spring boot application compression size limit not honored for server.compression.min-response-size configuration

Description: I've encountered an issue where Spring Boot does not seem to respect the server.compression.min-response-size property. I have this property set to 10KB, which should mean that responses smaller than 10 KB are not compressed. However, I've observed that smaller responses are still being compressed.

Steps to Reproduce: 1. Set up a basic Spring Boot application with spring-boot-starter-web. 2. Add server.compression.enabled=true and server.compression.min-response-size=10240 to application.properties. 3. Create a simple endpoint that returns a small payload less than 10 KB. 4. Observe the response using a tool like Postman to check if the response is compressed.

Expected Behavior: Responses smaller than 10 KB should not be compressed.

Actual Behavior: Responses smaller than 10 KB are compressed.

Please refer demo app here: https://github.com/harshalpatil2012/spring_book_gzip_app

application.properties file content: server.compression.enabled=true server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain server.compression.min-response-size=10240

Local_Test

Comment From: bclozel

Thanks for the sample but unfortunately Spring Boot 2.7 is out of open source support. We can reopen this issue if you can reproduce the problem with a supported version.

Comment From: harshalpatil2012

@bclozel tested with latest Spring boot version-3.2.5. Still same issue. Can we check this issue?

Comment From: bclozel

This duplicates #19942

Comment From: harshalpatil2012

@bclozel can this be issue taken for investigation?

Comment From: bclozel

This is working as expected. See the issue I mentioned.