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

Portability | portable
Stability | Unstable
Maintainer | Michael Snoyman <michael@snoyman.com>
Safe Haskell | None

Network.Wai.Middleware.Gzip

Description

Automatic gzip compression of responses.

Synopsis

- gzip :: GzipSettings -> Middleware
- data GzipSettings
- gzipFiles :: GzipSettings -> GzipFiles
- data GzipFiles
  - = GzipIgnore
  - | GzipCompress
  - | GzipCacheFolder FilePath
- gzipCheckMime :: GzipSettings -> ByteString -> Bool
- def :: Default a => a
- defaultCheckMime :: ByteString -> Bool

# 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.

Possible future enhancements:

- Only compress if the response is above a certain size.

data GzipSettings Source

Instances

Default GzipSettings |

gzipFiles :: GzipSettings -> GzipFiles Source

data GzipFiles Source

Constructors

GzipIgnore |
GzipCompress |
GzipCacheFolder FilePath |

Instances

Eq GzipFiles |
Read GzipFiles |
Show GzipFiles |

gzipCheckMime :: GzipSettings -> ByteString -> Bool Source

def :: Default a => a

The default value for this type.

defaultCheckMime :: ByteString -> Bool Source