Copyright | Michael Snoyman |
---|---|
License | BSD3 |
Maintainer | Michael Snoyman <michael@snoyman.com> |
Stability | Unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Automatic gzip compression of responses.
- gzip :: GzipSettings -> Middleware
- data GzipSettings
- gzipFiles :: GzipSettings -> GzipFiles
- data GzipFiles
- 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.
File responses will be compressed according to the GzipFiles
setting.
data GzipSettings Source #
Default GzipSettings Source # | Use default MIME settings; do not compress files. |
gzipFiles :: GzipSettings -> GzipFiles Source #
Gzip behavior for files.
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. |
gzipCheckMime :: GzipSettings -> ByteString -> Bool Source #
defaultCheckMime :: ByteString -> Bool Source #
MIME types that will be compressed by default:
text/*
, application/json
, application/javascript
,
application/ecmascript
, image/x-icon
.