how to clear browser cache programmatically in jsp?

后端 未结 5 2241
情歌与酒
情歌与酒 2020-12-09 13:20

In my web application there is some problem due to browser cache.

How to clear the browser cache when loading my jsp page?

How can i include clear cache code

5条回答
  •  悲&欢浪女
    2020-12-09 14:04

    You can do this way in your JSP to prevent from caching,not able to clear the cache programatically:

     <% response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 
     response.setHeader("Pragma","no-cache"); //HTTP 1.0 
     response.setDateHeader ("Expires", 0); //prevents caching at the proxy server  
    %>
    

提交回复
热议问题