Type Method
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
initialByteBufferCapacityThe initial buffer capacity to use when instantiating the compressor.
allowedTypesThe types to allow to be compressed. If unspecified, no types will match, thus disabling compression unless explicitly overriden. Specify
compressibleto use a default set of types that compress well.allowRequestOverridesAllow routes and requests to explicitly enable compression. If unspecified, responses will not be compressed by default unless routes or responses explicitly enable it. See
ResponseCompressionMiddlewarefor more information.
Return Value
A response compression configuration.