Structure
HTTPServer.Configuration.ResponseCompressionConfiguration
Supported HTTP response compression options.
struct ResponseCompressionConfiguration
Topics
Instance Properties
var allowRequestOverrides: BoolAllow routes and requests to explicitly override compression.var initialByteBufferCapacity: IntThe initial buffer capacity to use when instantiating the compressor.
Type Properties
static let defaultInitialByteBufferCapacity: IntThe default initial byte buffer capacity to use for the compressor if none is specified.static var disabled: HTTPServer.Configuration.ResponseCompressionConfigurationDisables compression for all content types unless a route overrides the preference. This is the default.static var enabled: HTTPServer.Configuration.ResponseCompressionConfigurationEnables compression by default, disallowing already compressed types such as images or video, unless a route overrides the preference.static var enabledForCompressibleTypes: HTTPServer.Configuration.ResponseCompressionConfigurationDisables compression by default, but allows easily compressible types such as text, unless a route overrides the preference.static var forceDisabled: HTTPServer.Configuration.ResponseCompressionConfigurationDisables compression unconditionally.
Type Methods
static func disabled(initialByteBufferCapacity: Int, allowedTypes: HTTPMediaTypeSet, allowRequestOverrides: Bool) -> HTTPServer.Configuration.ResponseCompressionConfigurationDisables compression by default, but offers options to allow it for the specified types.static func enabled(initialByteBufferCapacity: Int) -> HTTPServer.Configuration.ResponseCompressionConfigurationEnables compression with custom configuration.static func enabled(initialByteBufferCapacity: Int, disallowedTypes: HTTPMediaTypeSet, allowRequestOverrides: Bool) -> HTTPServer.Configuration.ResponseCompressionConfigurationEnables compression by default, but offers options to disallow it for the specified types.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype