0 Replies Latest reply on Sep 26, 2002 4:38 PM by Angela

    Jetty/Tomcat Cache-Control problem

    Angela Newbie

      in my application servlet forwards request to jsp pages,
      In the servlet to prevent caching in doPost I have this logic:

      if(request.getProtocol().compareTo ("HTTP/1.0") == 0) {
      UIGlobals.out.logDebug("ServletBase [setNoCache] - HTTP/1.0");
      response.setHeader("Pragma", "no-cache");

      } else if (request.getProtocol().compareTo ("HTTP/1.1") == 0) {
      UIGlobals.out.logDebug("ServletBase [setNoCache] - HTTP/1.1");
      response.setHeader("Cache-Control", "no-cache");

      response.addHeader("Cache-Control", "must-revalidate");
      response.addHeader("Cache-Control", "max-age=0");
      response.setDateHeader ("Expires", 0);

      This appears to work just fine for Weblogic - IE browser does not cache the page, but on Jboss , IE still caches the page. I have heard that there is a problem with Tomcat about not setting the Cache-control headers correctly, but wanted to confirm whether this is the same situation with Jboss (Jetty/Tomcat). Please help!