hi all,
i am working on java-jsp application and using MS-SQL database.
when i do any update operation using front screen(in html),it gets
updated in the database but it dosen't show those updates in the
front end.
THE UPDATES ARE SEEN ONLY WHEN THE "EVERY TIME VISIT TO THIS PAGE"
option in "Tools /Internet Options /Settings " of the toolbar is SET.
OR ELSE I HAVE TO CLOSE THE BROWSER AND THEN OPEN A NEW ONE TO GET THE
UPDATES .
i can never know what option my client has set on his terminal.
what could be solution so that my code will be independent of the
internet setting?
please help me out as i am in a great hurry!
thank you.
Paul Davis - 14 Jul 2006 15:54 GMT
Arvind, you are up against the dreaded browser caching.
Some things you can do are, retreive the page using post instead of
get, change the expire time and last mod time in the response header,
and adding a random query string parameter to the link to the page.
Assuming a J2EE server the following will take care of you headers:
response.setHeader("Cache-Control", "no-store"); //HTTP 1.1
response.setHeader("Pragma", "no-cache"); //HTTP 1.0
response.setDateHeader("Expires", 0); // prevents caching at the proxy
server
For internet explorer you may need a combination of the above.
(note: post instead of get should always work)