Type Method
enabled(initialByteBufferCapacity:disallowedTypes:allowRequestOverrides:)
Enables compression by default, but offers options to disallow it for the specified types.
static func enabled(initialByteBufferCapacity: Int = defaultInitialByteBufferCapacity, disallowedTypes: HTTPMediaTypeSet = .incompressible, allowRequestOverrides: Bool = true) -> HTTPServer.Configuration.ResponseCompressionConfiguration
Parameters
initialByteBufferCapacityThe initial buffer capacity to use when instantiating the compressor.
disallowedTypesThe types to prevent from being compressed. If unspecified, incompressible types will match, thus disabling compression for media types unless explicitly overriden. Specify
noneto enable compression for all types by default.allowRequestOverridesAllow routes and requests to explicitly disable compression. If unspecified, responses will be compressed by default unless routes or responses explicitly disable it. See
ResponseCompressionMiddlewarefor more information.
Return Value
A response compression configuration.