there is no sure shot solution to prevent a client from caching your jsp's (damn microsoft traded performance for full implementation of the standards) the only real solution is to change the url (the page will be pulled from cache anytime the url is the same as that of the cached page) so do something like this http://www.whatever.com/jsps/myJsp.jsp?someVar="random number" and just ignore the variable someVar...but remember this to create unique url's every time u have to use some kinda random generation (or use a time stamp instead) do that and the browser will be foxed into getting the page from the server and not from the cache.
did this make any sense... manav
Joined: Aug 02, 2000
Very clever. Used the time stamp idea...it ROCKS! Thanks
Hi, For preventing this problem, add the following two line at the starting of ur jsp scripting in the jsp page <% response.setHeader("Cache-Control", "no-cache"); response.setHeader("Expires","0"); %> I am sure this will fetch the new updated copy of ur jsp every time.
Originally posted by manav kher: there is no sure shot solution to prevent a client from caching your jsp's (damn microsoft traded performance for full implementation of the standards) the only real solution is to change the url [...]
Seconded. I did a financial forecasting intranet application a while ago and ran into the same problem. You really don't want to be looking at yesterday's data. I tried everything else before resigning to this - all HTTP headers that could be halfway relevant (Pragma, Cache-Control, Expires, Last-Modified) and their META equivalents, it just didn't fully solve the problem. Only including a dummy timestamp in the URL completely eliminated caching. - Peter
[This message has been edited by Peter den Haan (edited June 27, 2001).]