allowRequestOverrides
Allow routes and requests to explicitely override compression.
var allowRequestOverrides: Bool { get set }
Allow routes and requests to explicitely override compression.
var allowRequestOverrides: Bool { get set }
s5Vapor10HTTPServerC13ConfigurationV019ResponseCompressionC0V21allowRequestOverridesSbvp
What are these?6PNX4
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
struct ResponseCompressionConfiguration
Supported HTTP response compression options.
final class HTTPServer
struct Configuration
Engine server config struct.
@frozen struct Bool
A value type whose instances are either true
or false
.
struct ResponseCompressionMiddleware
Overrides the response compression settings for a route.
static let defaultInitialByteBufferCapacity: Int
The default initial byte buffer capacity to use for the compressor if none is specified.
static var disabled: Self { get }
Disables compression for all content types unless a route overrides the preference. This is the default.
static var enabled: Self { get }
Enables compression by default, dissallowing already compressed types such as images or video, unless a route overrides the preference.
static var enabledForCompressibleTypes: Self { get }
Disables compression by default, but allows easily compressible types such as text, unless a route overrides the preference.
static var forceDisabled: Self { get }
Disables compression unconditionally.
static func disabled(initialByteBufferCapacity: Int = defaultInitialByteBufferCapacity, allowedTypes: HTTPMediaTypeSet = .none, allowRequestOverrides: Bool = true) -> HTTPServer.Configuration.ResponseCompressionConfiguration
Disables compression by default, but offers options to allow it for the specified types.
static func enabled(initialByteBufferCapacity: Int = defaultInitialByteBufferCapacity, disallowedTypes: HTTPMediaTypeSet = .incompressible, allowRequestOverrides: Bool = true) -> HTTPServer.Configuration.ResponseCompressionConfiguration
Enables compression by default, but offers options to dissallow it for the specified types.
var initialByteBufferCapacity: Int { get set }
The initial buffer capacity to use when instanciating the compressor.
static func enabled(initialByteBufferCapacity: Int) -> HTTPServer.Configuration.ResponseCompressionConfiguration
Enables compression with custom configuration.