Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to prevent caching

 
giang nguyen
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dave Cronin
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this. Setting the HTTP Header is more effective than using META tags.
 
giang nguyen
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic