@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,
String acceptEncoding) |
protected void |
encode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpObject msg,
List<Object> out) |
boolean |
shouldSkip(io.netty.handler.codec.http.HttpResponse response)
Determines if encoding should occur based on the response.
|
determineEncoding, 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, List<Object> out) throws Exception
encode
in class io.netty.handler.codec.http.HttpContentEncoder
Exception