Bug 36463

Summary: We should compress our JSON responses (gzip deflate mod_deflate application/json)
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Architecture, internals, and plumbingAssignee: Nick Clemens (kidclamp) <nick>
Status: Pushed to oldstable --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: f.demians, fridolin.somers, jonathan.druart, julian.maurice, lucas, m.de.rooy, phil, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35799
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.06,23.05.12
Circulation function:
Bug Depends on:    
Bug Blocks: 36531    
Attachments: Bug 36463: Compress application/json
Bug 36463: Compress application/json
Bug 36463: (follow-up) Adjust other occurence (intranet)
Bug 36463: (follow-up) Adjust other occurence (intranet)
Bug 36463: Compress application/json
Bug 36463: (follow-up) Adjust other occurence (intranet)

Description Nick Clemens (kidclamp) 2024-03-29 12:54:12 UTC
We serve most types with gzip encoding, but not application/json
Comment 1 Nick Clemens (kidclamp) 2024-03-29 12:56:53 UTC Comment hidden (obsolete)
Comment 2 Phil Ringnalda 2024-03-29 15:48:06 UTC
Created attachment 164137 [details] [review]
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

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Comment 3 Frédéric Demians 2024-03-29 16:01:46 UTC
In etc/koha-httpd.conf, they are two mod_deflate.c section. Your patch modify the 1st one, not the 2nd one. Isn't it necessary?
Comment 4 Nick Clemens (kidclamp) 2024-03-29 16:12:14 UTC
Created attachment 164138 [details] [review]
Bug 36463: (follow-up) Adjust other occurence (intranet)
Comment 5 Frédéric Demians 2024-03-29 16:30:20 UTC
Created attachment 164139 [details] [review]
Bug 36463: (follow-up) Adjust other occurence (intranet)

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Comment 6 Martin Renvoize (ashimema) 2024-04-08 11:26:57 UTC
Created attachment 164496 [details] [review]
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

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize (ashimema) 2024-04-08 11:27:00 UTC
Created attachment 164497 [details] [review]
Bug 36463: (follow-up) Adjust other occurence (intranet)

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize (ashimema) 2024-04-08 11:28:11 UTC
Nice improvement.. works and is clean

Passing QA
Comment 9 Katrin Fischer 2024-04-08 13:42:55 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 10 Fridolin Somers 2024-05-23 12:18:55 UTC
Pushed to 23.11.x for 23.11.06
Comment 11 Lucas Gass 2024-05-28 17:45:44 UTC
Backported to 23.05.x for upcoming 23.05.12