0

How do I prevent the output of my JSP or Servlet pages from being cached by the browser? is there any way to disable?

4
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by masijade
0

and even then there's no guarantee the browser won't simply ignore it and still cache it.
And even if the browser doesn't cache, there's always a good chance of the request going through some proxy server that does cache (and they tend to be more likely to ignore no-cache commands than are browsers).

0

Yes there is a sample method of clearing cache memory through jsp pages it prevents the pages from caching

<% 
response.setHeader("Cache-Control","no-store"); 
response.setHeader("Pragma","no-cache"); 
response.setDateHeader ("Expires", 0);  
%>

dis worked for me fine to clear the cache

0

As has already been said.

It has also been noted that this is not guaranteed to the have desired effect. The browser (and especially proxy servers) do not have to honor these.

Edited by masijade: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.