add no-cache Pragma and Cache-control headers to the http response.. I see no reason...
authormh <mh>
Fri, 6 Dec 2002 08:12:42 +0000 (08:12 +0000)
committermh <mh>
Fri, 6 Dec 2002 08:12:42 +0000 (08:12 +0000)
source/Mir.java
source/OpenMir.java

index e24619f..afb3351 100755 (executable)
@@ -67,7 +67,7 @@ import mir.log.Log;
  * Mir.java - main servlet, that dispatches to servletmodules
  *
  * @author $Author: mh $
- * @version $Id: Mir.java,v 1.22 2002/11/04 04:35:20 mh Exp $
+ * @version $Id: Mir.java,v 1.23 2002/12/06 08:12:42 mh Exp $
  *
  */
 
@@ -95,11 +95,10 @@ public class Mir extends AbstractServlet {
         EntityUsers userEntity;
         String http = "";
 
-        // get the configration - this could conflict if 2 mirs are in the
-        // VM maybe? to be checked. -mh
         if (getServletContext().getAttribute("mir.confed") == null) {
             getConfig(req);
         }
+
         MirConfig.setServletName(getServletName());
 
         //*** test
@@ -109,6 +108,14 @@ public class Mir extends AbstractServlet {
         userEntity = (EntityUsers) session.getAttribute("login.uid");
 
         if (req.getServerPort() == 443) http = "https"; else http = "http";
+
+        //nothing in Mir can or should be cached as it's all dynamic...
+        //
+        //this needs to be done here and not per page (via meta tags) as some
+        //browsers have problems w/ it per-page -mh
+        res.setHeader("Pragma", "no-cache");
+        res.setDateHeader("Expires", 0);
+        res.setHeader("Cache-Control", "no-cache");
         res.setContentType("text/html; charset="
                             +MirConfig.getProp("Mir.DefaultEncoding"));
         String moduleName = req.getParameter("module");
index 2c6f092..8190280 100755 (executable)
@@ -50,7 +50,8 @@ import mircoders.storage.*;
 /**
  *  OpenMir.java - main servlet for open posting and comment feature to articles
  *
- *  @author RK 1999-2001
+ *  @author RK 1999-2001, the mir-coders group
+ *  @version $Id: OpenMir.java,v 1.16 2002/12/06 08:12:42 mh Exp $
  *
  */
 
@@ -79,6 +80,7 @@ public class OpenMir extends AbstractServlet {
     if(getServletContext().getAttribute("mir.confed") == null) {
       getConfig(req);
     }
+      
     session = req.getSession();
 
     if(session.getAttribute("Language")==null){
@@ -93,6 +95,13 @@ public class OpenMir extends AbstractServlet {
     if (req.getParameter("language")!=null)
       setLocale(session, new Locale(req.getParameter("language"), "") );
 
+    //nothing in Mir can or should be cached as it's all dynamic...
+    //
+    //this needs to be done here and not per page (via meta tags) as some
+    //browsers have problems w/ it per-page -mh
+    res.setHeader("Pragma", "no-cache");
+    res.setDateHeader("Expires", 0);
+    res.setHeader("Cache-Control", "no-cache");
     res.setContentType("text/html; charset="
                       +MirConfig.getProp("Mir.DefaultEncoding"));
     try {