wai-extra-3.0.16.1: Provides some basic WAI handlers and middleware.

CopyrightMichael Snoyman
LicenseBSD3
MaintainerMichael Snoyman <michael@snoyman.com>
StabilityUnstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Network.Wai.Middleware.Gzip

Description

Automatic gzip compression of responses.

Synopsis

Documentation

gzip :: GzipSettings -> Middleware Source #

Use gzip to compress the body of the response.

Analyzes the "Accept-Encoding" header from the client to determine if gzip is supported.

File responses will be compressed according to the GzipFiles setting.

data GzipSettings Source #

Instances

Default GzipSettings Source #

Use default MIME settings; do not compress files.

Methods

def :: GzipSettings #

data GzipFiles Source #

Gzip behavior for files.

Constructors

GzipIgnore

Do not compress file responses.

GzipCompress

Compress files. Note that this may counteract zero-copy response optimizations on some platforms.

GzipCacheFolder FilePath

Compress files, caching them in some directory.

def :: Default a => a #

The default value for this type.

defaultCheckMime :: ByteString -> Bool Source #

MIME types that will be compressed by default: text/*, application/json, application/javascript, application/ecmascript, image/x-icon.