← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17320: Removed config of max http cache filter. Not ideal since static files might end up in nginx cache...

 

------------------------------------------------------------
revno: 17320
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-10-31 07:41:15 -0400
message:
  Removed config of max http cache filter. Not ideal since static files might end up in nginx cache forever.
modified:
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/servlet/filter/HttpMaxCacheFilter.java
  dhis-2/dhis-web/dhis-web-portal/src/main/webapp/WEB-INF/web.xml


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/servlet/filter/HttpMaxCacheFilter.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/servlet/filter/HttpMaxCacheFilter.java	2014-10-17 16:11:39 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/servlet/filter/HttpMaxCacheFilter.java	2014-10-31 11:41:15 +0000
@@ -44,6 +44,23 @@
 import org.joda.time.DateTime;
 
 /**
+ * Filter which adds max expiry cache headers to responses. Can be configured in
+ * web.xml with:
+ * 
+ * <filter>
+ *   <filter-name>HttpMaxCacheFilter</filter-name>
+ *   <filter-class>org.hisp.dhis.servlet.filter.HttpMaxCacheFilter</filter-class>
+ *   <init-param>
+ *     <param-name>regex</param-name>
+ *     <param-value>(\.js|\.css|\.gif|\.woff|\.ttf|\.eot|\.ico|(/dhis-web-commons/|/images/|/icons/).*\.png)$</param-value>
+ *   </init-param>
+ * </filter>
+ *  
+ * <filter-mapping>
+ *   <filter-name>HttpMaxCacheFilter</filter-name>
+ *   <url-pattern>/*</url-pattern>
+ * </filter-mapping>
+ * 
  * @author Lars Helge Overland
  */
 public class HttpMaxCacheFilter

=== modified file 'dhis-2/dhis-web/dhis-web-portal/src/main/webapp/WEB-INF/web.xml'
--- dhis-2/dhis-web/dhis-web-portal/src/main/webapp/WEB-INF/web.xml	2014-10-20 06:18:12 +0000
+++ dhis-2/dhis-web/dhis-web-portal/src/main/webapp/WEB-INF/web.xml	2014-10-31 11:41:15 +0000
@@ -24,14 +24,6 @@
     </init-param>
   </filter>
   <filter>
-    <filter-name>HttpMaxCacheFilter</filter-name>
-    <filter-class>org.hisp.dhis.servlet.filter.HttpMaxCacheFilter</filter-class>
-    <init-param>
-      <param-name>regex</param-name>
-      <param-value>(\.js|\.css|\.gif|\.woff|\.ttf|\.eot|\.ico|(/dhis-web-commons/|/images/|/icons/).*\.png)$</param-value>
-    </init-param>
-  </filter>
-  <filter>
     <filter-name>shallowEtagHeaderFilter</filter-name>
     <filter-class>org.springframework.web.filter.ShallowEtagHeaderFilter</filter-class>
   </filter>
@@ -73,10 +65,6 @@
     <url-pattern>/</url-pattern>
   </filter-mapping>
   <filter-mapping>
-    <filter-name>HttpMaxCacheFilter</filter-name>
-    <url-pattern>/*</url-pattern>
-  </filter-mapping>
-  <filter-mapping>
     <filter-name>OpenSessionInViewFilter</filter-name>
     <url-pattern>*.action</url-pattern>
   </filter-mapping>