Question

In my web application i clear the cache of the web pages with these instructions

<%
response.addHeader("Cache-Control", "no-cache,no-store,private,must-revalidate,max-stale=0,post-check=0,pre-check=0"); 
response.addHeader("Pragma", "no-cache"); 
response.addDateHeader ("Expires", 0);
%>

But if I press the button ("Back") of the browser, it does not load the page more(The web pages expired). enter image description here How can i solve it?

Was it helpful?

Solution

If you use JSF 1.2 or higher you need change it like this:

<h:head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="expires" content="0" />
</h:head>

it can be part of template.xhtml

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top