summaryrefslogtreecommitdiff
path: root/etc/apache2/conf-available/local-compression.conf
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2022-09-16 19:28:17 +0200
committerJonas Smedegaard <dr@jones.dk>2022-09-16 19:28:17 +0200
commit8cf6d74daa4b4e6a3673df40ed1372a72eb05474 (patch)
treef500238e2f4c3708fa577d550d10a10a1b9e7a56 /etc/apache2/conf-available/local-compression.conf
parente5f5aa061409030fc63b04704b3b3f3f703b16b1 (diff)
add apache2 snippets local-compression local-tls from local-COMMONHEADdevelopment
Diffstat (limited to 'etc/apache2/conf-available/local-compression.conf')
-rw-r--r--etc/apache2/conf-available/local-compression.conf22
1 files changed, 22 insertions, 0 deletions
diff --git a/etc/apache2/conf-available/local-compression.conf b/etc/apache2/conf-available/local-compression.conf
new file mode 100644
index 0000000..03d4299
--- /dev/null
+++ b/etc/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>