From be905428722522f1ace4e99d13ffcb5d11f65657 Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Wed, 5 Jun 2013 17:50:29 +1200 Subject: [PATCH] Bug 10411: add cache control headers for static resources (Debian package) 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 Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- debian/templates/apache-shared.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/templates/apache-shared.conf b/debian/templates/apache-shared.conf index 077bd7fc17..33c663303c 100644 --- a/debian/templates/apache-shared.conf +++ b/debian/templates/apache-shared.conf @@ -56,6 +56,13 @@ SetEnv PERL5LIB "/usr/share/koha/lib" + + 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" + Options +FollowSymLinks -- 2.20.1