Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to "force" a page to be requested on every visit to it? 1

Status
Not open for further replies.

royboy75

Programmer
Feb 13, 2007
114
GB
Hello,

I have a page which is using AJAX to call a JSP that gathers some information from the backend database and sends it to the client for display.
Everything is working OK.
The problem I have is that if I change the database content is changed the new content is not displayed to the user even if he refreshes the page. Only when the user delets his temporary internet files the new content is reflected.
Now, of course I can change the user's browser settings to check for new version of the page on every visit and in this case it does work (tested it myself, it is working in this case). But, I don't want all the users to change their settings just for one page. I am sure that there is a property on the html/jsp page that says that.
Any ideas...?

 
Hi

This is not JavaScript question, so neither AJAX.

It is HTTP, and the browser is not informed about the validity of the received document. The quick & dirty solution is to just send out some cache control HTTP headers. So the most appropriate is to solve it is JSP and you should post this is forum695. But better read this first :


Feherke.
 
The tip you refered me to did the trick! :)
 
Hey,

One more question: Is it possible to do this forcing on a plain html page as well?
 
Hi

Theoretically yes. You may include the same in [tt]meta[/tt] tags with [tt]http-equi[/tt] attribute. But I have some memories about occasional mises in Explorer. ( I think was service pack related. You know, some problems are solved by simply disabling features. )
Code:
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top