Forum OpenACS Q&A: how to force reload html page.

Collapse
Posted by Bikui Chen on
I am designing a page, whose contents will change according to the
input of user. But it always retrieves data from cache, which is
stale copy. how to force it to reload html page in ACS? Thanks.
Hi Bikui!
well, in your http header you should write something like:
ns_write "HTTP/1.0 200 OK
MIME-Version: 1.0
Content-Type: text/html
Pragma: no-cache

the rest of the page goes here
....
"

The no-cache thing is what you are looking for... 
Collapse
Posted by James Harris on

Be warned, that if you expect Microsoft browsers that this is often not enough to prevent caching. You also need to add the following after the closing body tag.

<HEAD>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD>

See http://support.microsoft.com/support/kb/articles/Q222/0/64.ASP.