You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is currently possible to configure HTTP compression in both client and server and enable this feature only if the message body is larger than minResponseSize.
Other servers like Undertow, Tomcat and Jetty allow for more flexible strategies; this is how Spring Boot supports the following options:
server.compression.enabled=false # If response compression is enabled.server.compression.excluded-user-agents= # List of user-agents to exclude from compression.server.compression.mime-types=text/html,text/xml,text/plain,text/css,text/javascript,application/javascript # Comma-separated list of MIME types that should be compressed.server.compression.min-response-size=2048 # Minimum response size that is required for compression to be performed.
Some servers choose to provide those options directly, others provide a Predicate based system that decides whether compression should be enabled for the given message or not. For reactor-netty, a Predicate<HttpMessage> would fit in the current picture.
I'd be happy to provide a PR if the team agrees with such a change.
HttpServerBuilder now exposes a compression(BiPredicate<Req,Res>).
The predicate is evaluated before committing response header/status.
If the predicate is true, compression is enabled for the given response.
The minimum compression threshold now uses content-length predicate.
It is currently possible to configure HTTP compression in both client and server and enable this feature only if the message body is larger than
minResponseSize
.Other servers like Undertow, Tomcat and Jetty allow for more flexible strategies; this is how Spring Boot supports the following options:
Some servers choose to provide those options directly, others provide a
Predicate
based system that decides whether compression should be enabled for the given message or not. For reactor-netty, aPredicate<HttpMessage>
would fit in the current picture.I'd be happy to provide a PR if the team agrees with such a change.
See spring-projects/spring-boot#10782
The text was updated successfully, but these errors were encountered: