Bug 36463 - We should compress our JSON responses (gzip deflate mod_deflate application/json)
Summary: We should compress our JSON responses (gzip deflate mod_deflate application/j...
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens (kidclamp)
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks: 36531
  Show dependency treegraph
 
Reported: 2024-03-29 12:54 UTC by Nick Clemens (kidclamp)
Modified: 2024-05-28 17:45 UTC (History)
9 users (show)

See Also:
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


Attachments
Bug 36463: Compress application/json (2.13 KB, patch)
2024-03-29 12:56 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 36463: Compress application/json (2.18 KB, patch)
2024-03-29 15:48 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 36463: (follow-up) Adjust other occurence (intranet) (998 bytes, patch)
2024-03-29 16:12 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 36463: (follow-up) Adjust other occurence (intranet) (1.11 KB, patch)
2024-03-29 16:30 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 36463: Compress application/json (2.25 KB, patch)
2024-04-08 11:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 36463: (follow-up) Adjust other occurence (intranet) (1.18 KB, patch)
2024-04-08 11:27 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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 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 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