disabled(initialByteBufferCapacity:allowedTypes:allowRequestOverrides:)
Disables compression by default, but offers options to allow it for the specified types.
static func disabled(initialByteBufferCapacity: Int = defaultInitialByteBufferCapacity, allowedTypes: HTTPMediaTypeSet = .none, allowRequestOverrides: Bool = true) -> HTTPServer.Configuration.ResponseCompressionConfiguration
Parameters
- initialByteBufferCapacity
The initial buffer capacity to use when instanciating the compressor.
- allowedTypes
The types to allow to be compressed. If unspecified, no types will match, thus disabling compression unless explicitly overriden. Specify
compressible
to use a default set of types that compress well.- allowRequestOverrides
Allow routes and requests to explicitely enable compression. If unspecified, responses will not be compressed by default unless routes or responses explicitely enable it. See
ResponseCompressionMiddleware
for more information.
Returns
A response compression configuration.