Network.Wai.Middleware.Gzip

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

Copyright | Michael Snoyman
License | BSD3
Maintainer | Michael Snoyman <michael@snoyman.com>
Stability | Unstable
Portability | portable
Safe Haskell | None
Language | Haskell98

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

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

Instances

Default GzipSettings |

gzipFiles :: GzipSettings -> GzipFiles

data GzipFiles

Constructors

GzipIgnore |
GzipCompress |
GzipCacheFolder FilePath |

Instances

Eq GzipFiles |
Read GzipFiles |
Show GzipFiles |

gzipCheckMime :: GzipSettings -> ByteString -> Bool

def :: Default a => a

The default value for this type.

defaultCheckMime :: ByteString -> Bool