title: How to control cache in JSP page?
body: <p>I created a Servlet filter with the following code in doFilter:</p>
  
  <pre><code>HttpServletResponse httpResponse = (HttpServletResponse)response;
  
  httpResponse.setHeader("Cache-Control","no-cache");
  httpResponse.setHeader("Pragma","no-cache");
  httpResponse.setDateHeader("Expires", 0); 
  
  chain.doFilter(request, response);
  </code></pre>
  
  <p>I want to make sure that nothing gets cached at the Client and every request (even the one's from the Browser's back button) are directed to the Server.</p>
  
  <p>But, even after implementing the above filter, some pages are cached (accessible using browser's back button).</p>
  
  <p>And other pages that are not cached, show <strong>Web Page Expired</strong> error in Internet Explorer.</p>