如何在jsp中以编程方式清除浏览器缓存?

如何在jsp中以编程方式清除浏览器缓存?

问题描述:

在我的网络应用程序中,由于浏览器缓存存在一些问题。

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

如何在加载我的jsp页面时清除浏览器缓存?

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

如何在jsp页面中包含清除缓存代码?

How can i include clear cache code in jsp page?

你可以这样做你的JSP到阻止缓存,无法以编程方式清除缓存:

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  
%>