Structure
HTTPServer.Configuration.ResponseCompressionConfiguration
Supported HTTP response compression options.
struct ResponseCompressionConfiguration
Topics
Instance Properties
allowRequestOverridesAllow routes and requests to explicitly override compression.initialByteBufferCapacityThe initial buffer capacity to use when instantiating the compressor.
Type Properties
defaultInitialByteBufferCapacityThe default initial byte buffer capacity to use for the compressor if none is specified.disabledDisables compression for all content types unless a route overrides the preference. This is the default.enabledEnables compression by default, disallowing already compressed types such as images or video, unless a route overrides the preference.enabledForCompressibleTypesDisables compression by default, but allows easily compressible types such as text, unless a route overrides the preference.forceDisabledDisables compression unconditionally.
Type Methods
disabled(initialByteBufferCapacity:allowedTypes:allowRequestOverrides:)Disables compression by default, but offers options to allow it for the specified types.enabled(initialByteBufferCapacity:)Enables compression with custom configuration.enabled(initialByteBufferCapacity:disallowedTypes:allowRequestOverrides:)Enables compression by default, but offers options to disallow it for the specified types.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype