Bugzilla – Attachment 164465 Details for
Bug 36531
Koha should serve text/javascript compressed, like application/javascript is
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36531: Serve text/javascript compressed, like application/javascript is
Bug-36531-Serve-textjavascript-compressed-like-app.patch (text/plain), 3.75 KB, created by
David Nind
on 2024-04-05 10:32:20 UTC
(
hide
)
Description:
Bug 36531: Serve text/javascript compressed, like application/javascript is
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-04-05 10:32:20 UTC
Size:
3.75 KB
patch
obsolete
>From bc619a9746e06543745456374721bb4b565e8a71 Mon Sep 17 00:00:00 2001 >From: Phil Ringnalda <phil@chetcolibrary.org> >Date: Thu, 4 Apr 2024 18:59:34 -0700 >Subject: [PATCH] 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> >--- > debian/templates/apache-shared.conf | 2 +- > etc/koha-httpd.conf | 6 ++++-- > 2 files changed, 5 insertions(+), 3 deletions(-) > >diff --git a/debian/templates/apache-shared.conf b/debian/templates/apache-shared.conf >index e3ad79cc04..b9e3ce9b85 100644 >--- a/debian/templates/apache-shared.conf >+++ b/debian/templates/apache-shared.conf >@@ -37,7 +37,7 @@ 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 >- AddOutputFilterByType DEFLATE application/javascript application/x-javascript application/json >+ AddOutputFilterByType DEFLATE application/javascript text/javascript application/x-javascript application/json > > DeflateCompressionLevel 9 > >diff --git a/etc/koha-httpd.conf b/etc/koha-httpd.conf >index 71160a5b7a..f09bfaf91c 100644 >--- a/etc/koha-httpd.conf >+++ b/etc/koha-httpd.conf >@@ -50,6 +50,7 @@ > mod_gzip_item_exclude rspheader Content-Type:image/* > mod_gzip_item_include file \.js$ > mod_gzip_item_include mime ^application/javascript$ >+ mod_gzip_item_include mime ^text/javascript$ > mod_gzip_item_include mime ^application/x-javascript$ > mod_gzip_item_include file \.php$ > mod_gzip_item_include mime ^text/html$ >@@ -62,7 +63,7 @@ > # 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 >- AddOutputFilterByType DEFLATE application/javascript application/x-javascript application/json >+ AddOutputFilterByType DEFLATE application/javascript text/javascript application/x-javascript application/json > > DeflateCompressionLevel 9 > >@@ -189,6 +190,7 @@ > mod_gzip_item_exclude rspheader Content-Type:image/* > mod_gzip_item_include file \.js$ > mod_gzip_item_include mime ^application/javascript$ >+ mod_gzip_item_include mime ^text/javascript$ > mod_gzip_item_include mime ^application/x-javascript$ > mod_gzip_item_include file \.php$ > mod_gzip_item_include mime ^text/html$ >@@ -201,7 +203,7 @@ > # 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 >- AddOutputFilterByType DEFLATE application/javascript application/x-javascript application/json >+ AddOutputFilterByType DEFLATE application/javascript text/javascript application/x-javascript application/json > > DeflateCompressionLevel 9 > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36531
:
164443
|
164465
|
164498