开发者

How to remove page caching using java

开发者 https://www.devze.com 2023-02-08 13:27 出处:网络
My web pages are开发者_Go百科 cached even when i used session.invalidate method. How can i remove caching of pages using java coding?You need to set the appropriate headers in your pages so that they

My web pages are开发者_Go百科 cached even when i used session.invalidate method. How can i remove caching of pages using java coding?


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"> 
0

精彩评论

暂无评论...
验证码 换一张
取 消