diff options
-rw-r--r-- | apache2/conf-available/local-compression.conf | 22 | ||||
-rw-r--r-- | apache2/mods-available/deflate.conf | 11 | ||||
-rw-r--r-- | apache2/mods-available/deflate.conf.diff | 22 |
3 files changed, 35 insertions, 20 deletions
diff --git a/apache2/conf-available/local-compression.conf b/apache2/conf-available/local-compression.conf new file mode 100644 index 0000000..03d4299 --- /dev/null +++ b/apache2/conf-available/local-compression.conf @@ -0,0 +1,22 @@ +# TODO: support serving pre-compressed files using Multi-Views +# <https://kevinlocke.name/bits/2016/01/20/serving-pre-compressed-files-with-apache-multiviews/> + +<IfDefine !TRANSFER_COMPRESSION> + <IfModule mod_brotli.c> + Define TRANSFER_COMPRESSION BROTLI_COMPRESS + </IfModule> +</IfDefine> +<IfDefine !TRANSFER_COMPRESSION> + <IfModule mod_deflate.c> + Define TRANSFER_COMPRESSION DEFLATE + </IfModule> +</IfDefine> + +<IfDefine TRANSFER_COMPRESSION> + <IfModule mod_filter.c> + AddOutputFilterByType ${TRANSFER_COMPRESSION} text/html text/plain text/xml text/css text/javascript + AddOutputFilterByType ${TRANSFER_COMPRESSION} application/x-javascript application/javascript application/ecmascript + AddOutputFilterByType ${TRANSFER_COMPRESSION} application/rss+xml + AddOutputFilterByType ${TRANSFER_COMPRESSION} application/xml + </IfModule> +</IfDefine> diff --git a/apache2/mods-available/deflate.conf b/apache2/mods-available/deflate.conf index 26a08f7..cfc4b20 100644 --- a/apache2/mods-available/deflate.conf +++ b/apache2/mods-available/deflate.conf @@ -1,12 +1,3 @@ -<IfModule mod_deflate.c> - <IfModule mod_filter.c> - AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript - AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript - AddOutputFilterByType DEFLATE application/json - AddOutputFilterByType DEFLATE application/rss+xml - AddOutputFilterByType DEFLATE application/wasm - AddOutputFilterByType DEFLATE application/xml - </IfModule> -</IfModule> +# enable conf snippet compression instead... # vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/apache2/mods-available/deflate.conf.diff b/apache2/mods-available/deflate.conf.diff index 210b644..b8e30e2 100644 --- a/apache2/mods-available/deflate.conf.diff +++ b/apache2/mods-available/deflate.conf.diff @@ -1,12 +1,14 @@ --- deflate.conf.orig +++ deflate.conf -@@ -2,7 +2,9 @@ - <IfModule mod_filter.c> - AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript - AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript -+ AddOutputFilterByType DEFLATE application/json - AddOutputFilterByType DEFLATE application/rss+xml -+ AddOutputFilterByType DEFLATE application/wasm - AddOutputFilterByType DEFLATE application/xml - </IfModule> - </IfModule> +@@ -1,10 +1,3 @@ +-<IfModule mod_deflate.c> +- <IfModule mod_filter.c> +- AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript +- AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript +- AddOutputFilterByType DEFLATE application/rss+xml +- AddOutputFilterByType DEFLATE application/xml +- </IfModule> +-</IfModule> ++# enable conf snippet compression instead... + + # vim: syntax=apache ts=4 sw=4 sts=4 sr noet |