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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to set nocache in javascript

Status
Not open for further replies.

lilyclar

Programmer
Nov 7, 2003
8
0
0
CA
Hi:

I want to "set nocache" to my web application so that when the user presses the back button,
it forces to reload the page, not the old page.

I am using javascript, server-side javascript is Livewire.

Do you know how to do it?

Thanks.
 
You could use JavaScript to write out the no-cache meta tag:

document.write(&quot;<META HTTP-EQUIV='Pragma' CONTENT='no-cache'><META HTTP-EQUIV='Expires' CONTENT='-1'>&quot;);

Adam
while(ignorance==true){perpetuate(violence,fear,hatred);life--};
 
hi, adam0101:

Thank you for your response.

I use put the two statements in the header. It works partly: when I press the a link, the page the link redireted to is refreshed every time.
But for the back and forward button (<-, ->), it does not force the page to refresh.

I would also like the back and forward button to enfore the refresh.

Can you come up with a better solution? :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top