gzip -package:freetype2
Generic zip controlled by a function with type-specific branches
Gzip compression with default parameters.
Use gzip to compress the body of the response.
Automatic gzip compression of responses.
CRC32 checksumming using the GZIP/PKZIP algorithm as used in both ISO
3309 and section 8.1.1.6.2 of ITU-T V.42 and referenced in RFC1952.
GZip file decompression
Copyright (c) 2004 John Goerzen, jgoerzen@complete.org
The GZip format is described in RFC1952.
Helpers for running a Snap web handler with compression.
This module exports utilities to compress and decompress GZip
pipes streams.
Twin map for monadic transformation
Twin map for transformation
The gzip format uses a header with a checksum and some optional
meta-data about the compressed file. It is intended primarily for
compressing individual files but is also sometimes used for network
protocols such as HTTP. The format is described in detail in RFC #1952
http://www.ietf.org/rfc/rfc1952.txt
This is not a format as such. It enabled zlib or gzip decoding with
automatic header detection. This only makes sense for decompression.
Decide which files to compress based on MIME type
The
ByteString is the value of the "Content-Type" response
header and will default to
False if the header is missing.
E.g. if you'd only want to compress
json data, you might
define your own function as follows:
myCheckMime mime = mime == "application/json"
Gzip behavior for files
Only applies to
ResponseFile (
responseFile) responses.
So any streamed data will be compressed based solely on the response
headers having the right "Content-Type" and "Content-Length". (which
are checked with
gzipCheckMime and
gzipSizeThreshold,
respectively)
Skip compression when the size of the response body is below this
amount of bytes (default: 860.)
Setting this option to less than 150 will actually increase
the size of outgoing data if its original size is less than 150
bytes.
This will only skip compression if the response includes a
"Content-Length" header AND the length is less than this
threshold.