Static Methodvapor 4.114.1Vapor

disabled(initialByteBufferCapacity:allowedTypes:allowRequestOverrides:)

Disables compression by default, but offers options to allow it for the specified types.

HTTPServerConfiguration+ResponseCompressionConfiguration.swift:71
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.