Mod Deflate
   HOME

TheInfoList



OR:

mod_deflate is an optional module for the
Apache HTTP Server The Apache HTTP Server ( ) is a free and open-source cross-platform web server software, released under the terms of Apache License 2.0. Apache is developed and maintained by an open community of developers under the auspices of the Apache So ...
, Apache v2.0 and later. It is based on Deflate
lossless data compression Lossless compression is a class of data compression that allows the original data to be perfectly reconstructed from the compressed data with no loss of information. Lossless compression is possible because most real-world data exhibits statistic ...
algorithm that uses a combination of the
LZ77 LZ77 and LZ78 are the two lossless data compression algorithms published in papers by Abraham Lempel and Jacob Ziv in 1977 and 1978. They are also known as LZ1 and LZ2 respectively. These two algorithms form the basis for many variations includin ...
algorithm and
Huffman coding In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. The process of finding or using such a code proceeds by means of Huffman coding, an algori ...
. This module provides the DEFLATE output filter that allows output from
Apache HTTP server The Apache HTTP Server ( ) is a free and open-source cross-platform web server software, released under the terms of Apache License 2.0. Apache is developed and maintained by an open community of developers under the auspices of the Apache So ...
to be compressed before being sent to the
client Client(s) or The Client may refer to: * Client (business) * Client (computing), hardware or software that accesses a remote service on another computer * Customer or client, a recipient of goods or services in return for monetary or other valuable ...
over the network. It also provides a filter for ''decompressing'' (''inflating'', ''uncompressing'') a
gzip gzip is a file format and a software application used for file compression and decompression. The program was created by Jean-loup Gailly and Mark Adler as a free software replacement for the compress program used in early Unix systems, and in ...
compressed ''response body''.


Limitation

The mod_deflate module does not have a lower bound for file size, so it attempts to compress files that are too small to benefit from compression. This results in files smaller than approximately 120 bytes becoming larger when processed by mod_deflate.


Compatibility

You can check a server to see if it is sending out compressed data, and compression compatibility of your browser for exampl
here
When textual content compressed using mod_gzip, it should maintain its
MIME-type A media type (also known as a MIME type) is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication o ...
, according to their recommended media type: * HTML: text/html * XHTML: application/xhtml+xml * CSS: text/css * JavaScript: application/x-javascript


Alternatives

The
mod_gzip mod_gzip is an external extension module for the Apache HTTP Server v1 and v2. It allows using the Gzip compression method for a significant reduction of the volume of web page content served over the HTTP protocol. mod_gzip can be compiled into ...
module is similar to mod_deflate, for Apache v1 and v2. A mod_gz module was independently developed by Ian Holsman. This module implements a gzip compression ''filter'' for Apache 2.0, providing similar functionality to mod_gzip. One important difference between the two modules is that mod_gzip includes its own gzip implementation, whereas mod_gz relies on an external zlib library. In
PHP PHP is a general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by The PHP Group ...
, a similar effect is achievable for the output of PHP scripts with: * th
ob_gzhandler()
and th
gzencode()
functions; * zlib.output_compression option in the php.ini file.
CherryPy CherryPy is an object-oriented web application framework using the Python programming language. It is designed for rapid development of web applications by wrapping the HTTP protocol but stays at a low level and does not offer much more than wha ...
offers the ''Gzip filter'', which uses th
zlib module
of Python standard library.


License

The mod_deflate module is part of Apache v2, licensed with Apache License 2.0.


History

Module level content compression for Apache started with
mod_gzip mod_gzip is an external extension module for the Apache HTTP Server v1 and v2. It allows using the Gzip compression method for a significant reduction of the volume of web page content served over the HTTP protocol. mod_gzip can be compiled into ...
, which is an external extension module, since Apache 1.3. The developers of the Apache 2.0.x servers have included mod_deflate in the codebase for the server to perform a similar GZIP-encoding function. Early versions provided lesser amount of compression than mod_gzip.Comparison of mod_deflate and mod_gzip
/ref> Starting with Apache 2.0.45, the compression level of mod_deflate is configurable using the ''DeflateCompressionLevel'' directive. This directive accepts values between 1 (fastest compression speed, lowest compression ratio) and 9 (slowest compression speed, highest compression ratio), with the default value being 6. This change made the compression in mod_deflate comparable to mod_gzip out of the box.


See also

*
HTTP compression HTTP compression is a capability that can be built into web servers and web clients to improve transfer speed and bandwidth utilization. HTTP data is compressed before it is sent from the server: compliant browsers will announce what methods are ...
* Some general purpose Apache modules * Some programming language interfaces for Apache


Notes

{{Reflist


External links


Apache Module mod_deflate
— for Apache 2.0.

— for Apache 2.2.
mod_deflate Compression Level Test
— File size Vs. server load - tested with Apache 2.2. Web server software Articles with underscores in the title Apache httpd modules