b9d4408648
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> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> (cherry picked from commitc52af2cef0
) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commit3e0c3032b6
) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
82 lines
2.7 KiB
Text
82 lines
2.7 KiB
Text
# Apache configuration settings that are shared for every Koha instance.
|
|
# This file contains settings that are the same for both the OPAC and
|
|
# the Intranet site.
|
|
#
|
|
# This file should be included from an instance's
|
|
# /etc/apache2/site-available file, once from the OPAC section, and once
|
|
# from the intranet section.
|
|
|
|
|
|
SetEnv PERL5LIB "/usr/share/koha/lib"
|
|
|
|
|
|
<IfModule mod_gzip.c>
|
|
mod_gzip_on yes
|
|
mod_gzip_dechunk yes
|
|
mod_gzip_keep_workfiles No
|
|
mod_gzip_can_negotiate yes
|
|
mod_gzip_update_static No
|
|
mod_gzip_temp_dir /tmp
|
|
mod_gzip_minimum_file_size 512
|
|
mod_gzip_maximum_file_size 1000000
|
|
mod_gzip_maximum_inmem_size 1000000
|
|
mod_gzip_handle_methods GET POST
|
|
mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
|
|
mod_gzip_item_exclude mime ^image/.*
|
|
mod_gzip_item_exclude rspheader Content-Type:image/*
|
|
mod_gzip_item_include file \.js$
|
|
mod_gzip_item_include mime ^application/x-javascript$
|
|
mod_gzip_item_include file \.php$
|
|
mod_gzip_item_include mime ^text/html$
|
|
mod_gzip_item_include file \.css$
|
|
mod_gzip_item_include mime ^text/css$
|
|
</IfModule>
|
|
|
|
|
|
<IfModule mod_deflate.c>
|
|
# 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 text/javascript application/x-javascript application/json
|
|
|
|
DeflateCompressionLevel 9
|
|
|
|
# Properly handle old browsers that do not support compression
|
|
BrowserMatch ^Mozilla/4 gzip-only-text/html
|
|
BrowserMatch ^Mozilla/4\.0[678] no-gzip
|
|
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
|
|
|
|
DeflateFilterNote Input instream
|
|
DeflateFilterNote Output outstream
|
|
DeflateFilterNote Ratio ratio
|
|
|
|
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
|
|
<IfModule mod_headers.c>
|
|
#properly handle requests coming from behind proxies
|
|
Header append Vary User-Agent
|
|
</IfModule>
|
|
</IfModule>
|
|
|
|
<IfModule mod_expires.c>
|
|
ExpiresActive on
|
|
ExpiresByType text/css "access plus 12 hours"
|
|
ExpiresByType application/javascript "access plus 12 hours"
|
|
ExpiresByType image/png "access plus 12 hours"
|
|
ExpiresByType image/gif "access plus 12 hours"
|
|
</IfModule>
|
|
|
|
Options +FollowSymLinks -Indexes
|
|
|
|
|
|
ErrorDocument 400 /cgi-bin/koha/errors/400.pl
|
|
ErrorDocument 401 /cgi-bin/koha/errors/401.pl
|
|
ErrorDocument 403 /cgi-bin/koha/errors/403.pl
|
|
ErrorDocument 404 /cgi-bin/koha/errors/404.pl
|
|
ErrorDocument 500 /cgi-bin/koha/errors/500.pl
|
|
|
|
RewriteEngine On
|
|
|
|
<IfModule mod_headers.c>
|
|
# Erase any X-Koha-SetEnv headers from the client
|
|
RequestHeader unset X-Koha-SetEnv
|
|
</IfModule>
|