From 494fd4f7e19dbe16056c4865614bf57760d1181e Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 29 Mar 2024 12:54:30 +0000 Subject: [PATCH] Bug 36463: Compress application/json This patch simply adds application/json to the mod_deflate configuration To test: 1 - Open the netowrk tab in firefox 2 - Load http://localhost:8081/api/v1/libraries 3 - Not the transferred size, and note no 'Content-Encoding: gzip" header 4 - Apply patch, reset_all (or edit /etc/koha/apache-shared.conf) 5 - Reload 6 - Note smaller size, note gzip header --- debian/templates/apache-shared.conf | 3 ++- etc/koha-httpd.conf | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/templates/apache-shared.conf b/debian/templates/apache-shared.conf index b923578e0b8..e3ad79cc040 100644 --- a/debian/templates/apache-shared.conf +++ b/debian/templates/apache-shared.conf @@ -36,7 +36,8 @@ SetEnv PERL5LIB "/usr/share/koha/lib" # Compress content with type html, text, and css, ... AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css - AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript + AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml + AddOutputFilterByType DEFLATE application/javascript application/x-javascript application/json DeflateCompressionLevel 9 diff --git a/etc/koha-httpd.conf b/etc/koha-httpd.conf index 867d309977f..3c68189f2f1 100644 --- a/etc/koha-httpd.conf +++ b/etc/koha-httpd.conf @@ -61,7 +61,8 @@ # Compress content with type html, text, and css, ... AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css - AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript + AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml + AddOutputFilterByType DEFLATE application/javascript application/x-javascript application/json DeflateCompressionLevel 9 -- 2.30.2