Skip to content

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

initialByteBufferCapacity

The initial buffer capacity to use when instantiating 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 explicitly enable compression. If unspecified, responses will not be compressed by default unless routes or responses explicitly enable it. See ResponseCompressionMiddleware for more information.

Return Value

A response compression configuration.