How to prevent caching in a JSP page?
Answered
How to prevent caching in a JSP page?
Best answer
Caching in JSP pages can be prevented by setting the appropriate HTTP header attributes.
The following scriptlet defined at the beginning of JSP pages can prevent them from being cached at the browser.
<% response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 response.setHeader("Pragma","no-cache"); //HTTP 1.0</p> //prevents caching at the proxy server response.setDateHeader("Last-Modified", (new Date()).getTime() ); %>