NIOHTTPCompression
Automatic compression and decompression of HTTP data.
import NIOHTTPCompression
Module information
- Declarations
- 64
- Symbols
- 143
Overview
Channel handlers to support automatic compression and decompression of HTTP data. Add the handlers to your pipeline to support the features you need.
Content-Encoding
, Content-Length
, and accept-encoding
HTTP headers are set and respected where appropriate.
Be aware that this works best if there is sufficient data written between flushes. This also performs compute on the event loop thread which could impact performance.
Client Channel Handlers
class NIOHTTPRequestCompressor
NIOHTTPRequestCompressor
is an outbound channel handler that handles automatic streaming compression of HTTP requests.class NIOHTTPResponseDecompressor
Duplex channel handler which will accept deflate and gzip encoded responses and decompress them.
Server Channel Handlers
class NIOHTTPRequestDecompressor
Channel hander to decompress incoming HTTP data.
class HTTPResponseCompressor
A
HTTPResponseCompressor
is a duplex channel handler that handles automatic streaming compression of HTTP responses. It respects the client’s Accept-Encoding preferences, including q-values if present, and ensures that clients are served the compression algorithm that works best for them.
Compression Methods
enum NIOCompression
Namespace for compression code.
enum NIOHTTPDecompression
Namespace for decompression code.