wood burning stoves 2.0*
The moose likes JSP and the fly likes how to prevent caching Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to prevent caching" Watch "how to prevent caching" New topic
Author

how to prevent caching

giang nguyen
Ranch Hand

Joined: May 13, 2003
Posts: 42
I use the following meta tags in my jsp file to prevent browser from caching
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
But it doesn't work. Some times, the browser keep displaying the old page.
Does any one can help ? I use session to store some shared data. Some time different users's session data is even mixed up. This is particularly frequent with ie 5.x. For i.e 6.x this rarely happens.
Note: I use websphere app server 4.05.
thanks alot


SCJP 1.4, SCWCD
Dave Cronin
Ranch Hand

Joined: Apr 25, 2003
Posts: 114
One possibility, if your network has a proxy server or firewall, the webpage is being cached on the proxy server. The browser cache-control would have no effect in the intermediate proxy server.


Dave Cronin
SCJP, SCWCD, SCBCD
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
Try this. Setting the HTTP Header is more effective than using META tags.


Mani
Quaerendo Invenietis
giang nguyen
Ranch Hand

Joined: May 13, 2003
Posts: 42
Originally posted by R Manivannan:
Try this. Setting the HTTP Header is more effective than using META tags.

That's great. It's true that my server is behind a proxy server. When i try your solution it works.
Many thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to prevent caching
 
Similar Threads
mock question regarding caching
browser caching
Session variables are getting hosed!
how to prevent caching in IE 6
IE 5.5 Page Reload Issues