[Bug 36531] New: Koha should serve text/javascript compressed, like application/javascript is
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 Bug ID: 36531 Summary: Koha should serve text/javascript compressed, like application/javascript is Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: phil@chetcolibrary.org Reporter: phil@chetcolibrary.org QA Contact: testopia@bugs.koha-community.org Depends on: 36463 Discovered via bug 36463, while we compress application/javascript, which is how we serve static .js files (though that may well be OS-dependent, coming from /etc/mime.types), we don't compress text/javascript, which is what output_with_http_headers produces when you ask for 'js'. That's actually currently the correct choice, since in May 2022 RFC 9239 obsoleted RFC 4329 which from 2006 to 2022 said that application/javascript was correct. Not many things seem to actually use output_with_http_headers for js (and most of them seem to actually mean json rather than js), but one huge one does: the initial load of svc/cataloguing/framework for the advanced cataloging editor loads an uncompressed 1.9MB of js (json, but because it's loaded through RequireJS, it winds up loaded as js rather than json, and serving it as json would produce an annoying browser warning) which compressed is a lovely 176KB. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36463 [Bug 36463] We should compress our JSON responses (gzip deflate mod_deflate application/json) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 --- Comment #1 from Phil Ringnalda <phil@chetcolibrary.org> --- Created attachment 164443 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164443&action=edit Bug 36531: Serve text/javascript compressed, like application/javascript is Koha serves static .js files as application/javascript (if /etc/mime.types says to) and serves them compressed, but output_with_http_headers uses the currently-correct text/javascript mimetype, and Koha doesn't compress that. Test plan: 1. Set the preference EnableAdvancedCatalogingEditor to Enable. 2. Open the browser Web Developer Tools to the Network tab 3. Load Cataloging - Advanced editor 4. Click on the line for the framework?frameworkcode=&callback=define load 5. Note the content-type text/javascript, no Content-Encoding line, and the size of 1.9MB 6. Apply the patches from bug 36463 if they haven't been pushed, then this patch, and reset_all 7. Repeat steps 1-4, and note a Content-Encoding: gzip header and a Transferred size around 160KB -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164443|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 164465 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164465&action=edit Bug 36531: Serve text/javascript compressed, like application/javascript is Koha serves static .js files as application/javascript (if /etc/mime.types says to) and serves them compressed, but output_with_http_headers uses the currently-correct text/javascript mimetype, and Koha doesn't compress that. Test plan: 1. Set the preference EnableAdvancedCatalogingEditor to Enable. 2. Open the browser Web Developer Tools to the Network tab 3. Load Cataloging - Advanced editor 4. Click on the line for the framework?frameworkcode=&callback=define load 5. Note the content-type text/javascript, no Content-Encoding line, and the size of 1.9MB 6. Apply the patches from bug 36463 if they haven't been pushed, then this patch, and reset_all 7. Repeat steps 1-4, and note a Content-Encoding: gzip header and a Transferred size around 160KB Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164465|0 |1 is obsolete| | --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 164498 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164498&action=edit Bug 36531: Serve text/javascript compressed, like application/javascript is Koha serves static .js files as application/javascript (if /etc/mime.types says to) and serves them compressed, but output_with_http_headers uses the currently-correct text/javascript mimetype, and Koha doesn't compress that. Test plan: 1. Set the preference EnableAdvancedCatalogingEditor to Enable. 2. Open the browser Web Developer Tools to the Network tab 3. Load Cataloging - Advanced editor 4. Click on the line for the framework?frameworkcode=&callback=define load 5. Note the content-type text/javascript, no Content-Encoding line, and the size of 1.9MB 6. Apply the patches from bug 36463 if they haven't been pushed, then this patch, and reset_all 7. Repeat steps 1-4, and note a Content-Encoding: gzip header and a Transferred size around 160KB Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |24.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|24.05.00 |24.05.00,22.11.06 released in| | --- Comment #5 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable CC| |lucas@bywatersolutions.com Version(s)|24.05.00,22.11.06 |24.05.00,22.11.06,23.05.12 released in| | --- Comment #6 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 23.05.x for upcoming 23.05.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 Laura O'Neil <laura@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |laura@bywatersolutions.com Version(s)|24.05.00,22.11.06,23.05.12 |24.05.00,23.11.06,23.05.12 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Pushed to oldoldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 Bug 36531 depends on bug 36463, which changed state. Bug 36463 Summary: We should compress our JSON responses (gzip deflate mod_deflate application/json) https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36463 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz Status|Pushed to oldoldstable |Needs documenting --- Comment #7 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 unless requested -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36531 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED CC| |david@davidnind.com --- Comment #8 from David Nind <david@davidnind.com> --- Bug fix, not covered in the manual - no update required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org