wai-extra-3.0.28: 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.

Will only be applied based on the gzipCheckMime setting. For default behavior, see defaultCheckMime.

data GzipSettings Source #

Instances
Default GzipSettings Source #

Use default MIME settings; do not compress files.

Instance details

Defined in Network.Wai.Middleware.Gzip

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.

GzipPreCompressed GzipFiles

If we use compression then try to use the filename with ".gz" appended to it, if the file is missing then try next action

Since: 3.0.17

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.