如何在jsp中以编程方式清除浏览器缓存? [英] how to clear browser cache programmatically in 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
%>
这篇关于如何在jsp中以编程方式清除浏览器缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文