According to your suggestion, I searched and implemented the code which I found from the site but it is not making any impact, I think there should be some different methodology required while we implements struts. my code <% response.setHeader("Cache-Control","no-store"); // HTTP 1.1 response.setHeader("Pragma","no-cache"); // HTTP 1.0 response.setDateHeader ("Expires", 0); %>
Hello Jignesh, Your problem is not on the server side but on the client side. You need to set the right HTTP headers (look the HTTP spec) to force the browser to ask again the page and not use the cache (read more about cache and HTTP protocol). You shoud use 'Expires, -1' and 'Control-cache, no-cache' Keep also the 'cache-control, no-store' header if you want to reload from server your page when the user clicks Back button to reload the previous page. I do not remenber exactly but IE 4 or 5 ignores completely one of these headers. Good luck
Joined: Oct 01, 2003
My problems is JSP pages are maintains Caches.
By the way: the way you express it makes me think you do not really understand caching. Browser or proxy caches your pages (html translated pages not JSP). Caching might be a complex problem: - it depends on users browser setting - it depends on your web server settings - it depends on HTTP headers (cahe related) you set in your page (check also your HTTP protocol version) - it depends if there is a proxy between the server and browser Read more.
Hi I accept the wordings are not proper. But the purpose was the same. And as you said I already ask for readling link. By the way I have implemented the solution suggested by you as follows but not impact. <% response.setDateHeader ("Expires", -1); response.setHeader("Pragma", "no-cache"); response.setHeader("Cache-Control", "no-store"); response.setHeader("Control-Cache","no-cache"); %>
There is a trick I used before .... Just add a dummy parameter to your URL String, then every time when a request is passed through the servlet / Action Class, apply a random number to that parameter before returning, so that the browser would see the URL link is different than last time, and will check for the latest version of the HTML page automatically. E.g. The link for the first time is http://localhost:7001/myApp/ListItem.jsp?dummy=13920, and the second time can be http://localhost:7001/myApp/ListItem.jsp?dummy=7489, which is different from the first one. Wendal [ May 07, 2004: Message edited by: Wendal Park ]