Problem Statement: Microservice is by default compressing in gzip format in response when Accept-Encoding is not sent in the header.
Spring boot version used: 2.1.7.RELEASE
Code:
I added the following in application.properties:
server.compression.enabled=true
Cases:
Test case 1:
Request with a header:- Accept-Encoding: gzip
Response in gzip (Works fine)
Test case 2:
Request with a header:- Accept-Encoding: xyz
Response not in gzip (Works fine)
Test case 3:
Request with a header:- Accept-Encoding:
Comment From: rstoyanchev
@dineshv1234567 what server is this with?
@snicoll should this really be in framework, considering server.compression.enabled
customizes server configuration (e.g. via TomcatConnectorCustomizer
)? I can't think of anything in Spring MVC related to compression, outside of serving gzipped static resources.
Comment From: snicoll
@rstoyanchev I mixed it up with something else, sorry about that.
@dineshv1234567 we'll need a small sample (zip or github repo) with instructions to reproduce those 4 test cases. If you have that in the form of a test, that would be ideal.
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.