Static Methodvapor 4.106.2Vapor

    enabled(initialByteBufferCapacity:disallowedTypes:allowRequestOverrides:)

    Enables compression by default, but offers options to dissallow it for the specified types.

    HTTPServerConfiguration+ResponseCompressionConfiguration.swift:90
    static func enabled(initialByteBufferCapacity: Int = defaultInitialByteBufferCapacity, disallowedTypes: HTTPMediaTypeSet = .incompressible, allowRequestOverrides: Bool = true) -> HTTPServer.Configuration.ResponseCompressionConfiguration

    Parameters

    initialByteBufferCapacity

    The initial buffer capacity to use when instanciating the compressor.

    disallowedTypes

    The types to prevent from being compressed. If unspecified, incompressible types will match, thus disabling compression for media types unless explicitly overriden. Specify none to enable compression for all types by default.

    allowRequestOverrides

    Allow routes and requests to explicitely disable compression. If unspecified, responses will be compressed by default unless routes or responses explicitely disable it. See ResponseCompressionMiddleware for more information.

    Returns

    A response compression configuration.

    Other members in extension

    Type members

    Show obsolete interfaces (1)

    Hide obsolete interfaces

    Instance members