Mod deflate » History » Revision 22
Revision 21 (gstrauss, 2016-09-11 01:15) → Revision 22/44 (gstrauss, 2016-10-17 00:05)
h2. mod_deflate mod_deflate is available in lighttpd 1.4.42 and later. a modified version of mod_compress. mod_deflate differs from mod_compress in that mod_deflate can compress any output from lighttpd static or dynamic. mod_deflate does not It doesn't support caching compressed output like mod_compress. Module options: <pre> deflate.enabled = "enable" deflate.mimetypes deflate.compression-level = ("text/html", "text/plain", "text/css", "text/javascript", "text/xml") 9 #deflate.mimetypes deflate.mem-level = ("text/") # prefix matches all text/* Content-Type responses 9 deflate.window-size = 15 deflate.bzip2 = "enable" deflate.allowed_encodings = ( "bzip2", "gzip", "deflate" ) deflate.max-compress-size = 131072 # measured in kilobytes, so 131072 indicates 128 MB deflate.min-compress-size = 256 # measured in bytes 200 deflate.compression-level #deflate.sync-flush = 9 "enable" #deflate.output-buffer-size = 8192 deflate.work-block-size = 2048 512 deflate.mimetypes = ("text/html", "text/plain", "text/css", "text/javascript", "text/xml") #deflate.debug = "enable" </pre> max-compress-size The sync-flush option allows dynamic scripts to flush output to the browser and still use compression. work-block-size is the largest response size that will be compressed. number of kilobytes to compress at one time, it allows the webserver to do other work (network I/O) in between compression. min-compress-size is the smallest response size that will be compressed. output-buffer-size is a per connection buffer for compressed output, it can help decrease the response size (fewer size(fewer chunks to encode). If it is set to zero, zero or if sync-flush is enabled a shared buffer will be used. h3. How to install for lighttpd 1.4.x work-block-size is *For 1.4.40 and later*: apply patch from https://github.com/lighttpd/lighttpd1.4/pull/67 First download the number patch (download links below) and place the patch outside of kilobytes the lighttpd-1.4.xx folder, then run: <pre> patch -p0 < lighttpd-1.4.xx-mod_deflate.diff </pre> This will patch your lighttpd-1.4.xx directory's files. Remember to compress at one time, it allows change xx to the version number you are using. Then: <pre> cd lighttpd-1.4.11 rm -f src/Makefile.in src/Makefile automake ./configure --with-bzip2 make make install </pre> Place mod_deflate after mod_rewrite in the webserver server.modules array in the lighttpd configuration file and enter in the mod_deflate configuration options. Remember to also enable bzip2 with the --with-bzip2 flag while doing the configure. h3. See Also [[Release-1_4_10-patches|Background Information of mod_deflate]] *For 1.4.40 and later*: https://github.com/lighttpd/lighttpd1.4/pull/67 h3. NOTE Patch files do other NOT work (network I/O) in between compression. with lighttpd 1.4.18 & 1.4.20 Could someone please create a new patch file? *For 1.4.40 and later*: https://github.com/lighttpd/lighttpd1.4/pull/67 h3. Feature Request #1824 adding mod_deflate to 1.4.xx tree h3. Known Limitation Bug mod_deflate currently does not stream compressed content #1709 wrong content-length with mod_fastcgi/mod_deflate combo (fixed in chunks. This affects very large dynamic responses, or dynamic responses sent in chunks with large time lapses between chunks. https://github.com/lighttpd/lighttpd1.4/pull/67)