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

dealing with caching in IE

 
Anthony Leroy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I've been testing my jsp site in both Netscape 4.08 and IE 4. I have an "edit details" window which pops up when a link is clicked and displays the current details in the input fields. This allows the user to edit the details. When the user hits save, the new info. is committed to the database and the window closes, and the page in the parent window is refreshed to reflect the new details in the DB.
In Netscape, once all this has been done, if the user clicks the link to edit the details again, the most recent details are displayed in the text fields in the popup window, but in IE, it loads the old version of the page so the old details are displayed.
When I right click > refresh it updates. How do I get it to automatically regenerate the page from the server and load it rather than loading the old version?
Thanks,
Ant
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
there are various ways to control this:
- <meta> tags in the html for setting caching
- modifying the response sent back from the server to indicate no caching should be done
Most of the time the various browsers ingore these to methods.
A common approach (and one that is successful) is to trick the browser in thinking it is requesting a new page each time.
This is done by appending a dummy variable to the query string of the url with a unique value (a timestamp is a good option).
eg. www.myserver.com?dummy=timeStampValue
This can be done using JavaScript and it's Date object.
James.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What a brilliant idea.

I'll have to try that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic