My web pages are cached even when i used session.invalidate method. How can i remove caching of pages using java coding?
Asked
Active
Viewed 795 times
1
-
http://stackoverflow.com/questions/511144/how-to-instruct-web-browsers-not-to-cache-pages – jmj Feb 03 '11 at 13:47
1 Answers
5
You need to set the appropriate headers in your pages so that they are not cached by the browser:
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", -1);
and
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
dogbane
- 254,755
- 72
- 386
- 405