Setting the cache control headers for static resources (css, images, javascript) 1) reduces traffic between the server and browser and 2) reduces the requests processed by Tomcat.
It does this by sending information to the browser that allowing it to maximize browser caching.
<filter> <display-name>MifosResponseHeaderFilter</display-name> <filter-name>MifosResponseHeaderFilter</filter-name> <filter-class>org.mifos.servlet.filters.MifosResponseHeaderFilter</filter-class> <init-param> <param-name>Cache-Control</param-name> <param-value>max-age=172800, public</param-value> </init-param> </filter> <filter-mapping> <filter-name>MifosResponseHeaderFilter</filter-name> <url-pattern>*.jpg</url-pattern> <url-pattern>*.gif</url-pattern> <url-pattern>*.js</url-pattern> <url-pattern>*.css</url-pattern> </filter-mapping> |
This will tell the browser that there is no need to request this static resource for 2 days (max-age=172800 - the value is in seconds).
From ShaminD release, Mifos comes with these cache-control headers already set up in the applications' web.xml
If this 'patch' is applied to the Tomcat/conf/web.xml then it needs to be removed before upgrading to ShaminD (release number and date not currently available).