Skip to content

ndv/mod_precompress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
ndv
Jan 4, 2018
733d37a · Jan 4, 2018

History

11 Commits
Sep 13, 2017
Jan 4, 2018
Sep 13, 2017

Repository files navigation

mod_precompress

Serve precompressed .gz files in Apache2. If the browser does not support gzip compression, the .gz files are decompressed and served as-is.

Install on Linux

  • Install the apache dev package:
sudo apt-get install apache2-dev
  • Make sure the mod_deflate module is enabled:
ls /etc/apache2/mods-enabled/deflate.load
  • Compile & install the module:
sudo apxs -cia mod_precompress.c

Install on Windows

  • Copy the corresponding pre-built 32- or 64- bit library from the win directory to apache/modules
  • Add the following line in httpd.conf or apache2.conf:
LoadModule precompress_module modules/mod_precompress.so

Usage

  • Enable precompression in the /etc/apache2/apache2.conf, in the <Directory ...> section:
<Directory />
    AllowOverride none
    Require all denied
    Precompressed on
</Directory>
  • Restart Apache:
sudo service apache2 restart
  • Compress static data:
cd /var/www/htdocs
gzip index.html

About

Serve precompressed .gz files in Apache2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages