@Internal public class SmartHttpContentCompressor extends io.netty.handler.codec.http.HttpContentCompressor
HttpContentCompressor
that skips encoding if the content type is not compressible or if
the content is too small.Modifier and Type | Method and Description |
---|---|
protected io.netty.handler.codec.http.HttpContentEncoder.Result |
beginEncode(io.netty.handler.codec.http.HttpResponse headers,
java.lang.String acceptEncoding) |
protected void |
encode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpObject msg,
java.util.List<java.lang.Object> out) |
boolean |
shouldSkip(io.netty.handler.codec.http.HttpResponse response)
Determines if encoding should occur based on the response.
|
determineWrapper, handlerAdded
acceptOutboundMessage, channelInactive, decode, handlerRemoved
acceptInboundMessage, channelRead, write
bind, close, connect, deregister, disconnect, flush, read
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
public boolean shouldSkip(io.netty.handler.codec.http.HttpResponse response)
response
- The responseprotected void encode(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpObject msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
encode
in class io.netty.handler.codec.http.HttpContentEncoder
java.lang.Exception
protected io.netty.handler.codec.http.HttpContentEncoder.Result beginEncode(io.netty.handler.codec.http.HttpResponse headers, java.lang.String acceptEncoding) throws java.lang.Exception
beginEncode
in class io.netty.handler.codec.http.HttpContentCompressor
java.lang.Exception