Currently, the static resources aren't explicitly cached. In the case of firefox, this causes a request every time for every image, that usually results in a 304 Not Modified response. This isn't a good use of apache's time, also may make the page appear to render a bit slower. The patch for this will put a 12 hour cache timeout on the images, javascript, and CSS files.
Created attachment 18653 [details] [review] Bug 10411 - add cache control headers for static resources 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.
Created attachment 19088 [details] [review] 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>
QA comment: Looks good to me, works as expected. Marked as Passed QA.
Created attachment 19750 [details] [review] 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>
Pushed to master. Thanks, Robin!
This patch has been pushed to 3.12.x, will be in 3.12.2. Thanks Robin!
Pushed to 3.10.x, will be in 3.10.10
Pushed to 3.8.x, will be in 3.8.17