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 commit c52af2cef0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3e0c3032b6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bccf7764c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d8afbbf661)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This was not added to the old etc/koha-httpd.conf because that file has
no infrastructure for Plack anyway.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Test plan:
* Go to http://library/opac-tmpl and check you get a 403 error instead
of a directory listing.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This adds caching directives to the static resources so that the browser
doesn't ask about them all the time.
By default, Debian apache doesn't have the required module (mod_expires)
enabled, and so this patch will have no effect. In order to enable this
function, run:
a2enmod expires
and restart apache.
Test Plan:
* Using firebug or equivalent, load a page.
* Note that none of the images, css, or js files have a Cache-Control or
Expires header set.
* Add this patch, redeploy the package with it (or overwrite the
apache-share.conf file) enable the 'expires' module, restart apache.
* Force-reload the page
* Note that the images, css, js now have Cache-Control and Expires set
for 12 hours into the future.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-common will be suitable for hosts with multiple Koha instances,
or those that otherwise need to do thing differently from the main
koha package.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>