Bug 10411: add cache control headers for static resources (Debian package)
authorRobin Sheat <robin@catalyst.net.nz>
Wed, 5 Jun 2013 05:50:29 +0000 (17:50 +1200)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 18 Jul 2013 13:50:56 +0000 (13:50 +0000)
commitbe905428722522f1ace4e99d13ffcb5d11f65657
treed625144d8d5f77d5721f8660f6be9298bd37d295
parentda6f2f7a7ddf1126d6e3b02825f0d45948f484fa
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 <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
debian/templates/apache-shared.conf