Web Agent Cache... how can this be avoided?

From an existing document, I make a call to an agenet which sets a field on the document in the background using the following javascript:

	url = "http://" + servername + "/" + dbname + "/" + "(agtDeleteUndeleteDoc)?openagent&deleteflag=" + flag + "&docunid="+unid;

	initRequest(url);

	req.onreadystatechange = processDeleteUndeleteRequest;

	req.open("GET", url, true);

	req.send(null);

where flag is either “True” or “” and is the value being set in the field. unid is the unique id of the document.

The agent simply gets the document by id and sets the value of the field, then saves the document.

The processDeleteUndeleteRequest function handles displaying the correct button (to toggle delete or undelete) and error processing. The issue that I have is that the agent gets cached and does not toggle the value if you delete, undelete, then delete again. The user would have to leave the page and come back. Clearing the temp files will of course also clear the cache. Is there a fairly standard way of forcing the agent call to not cache when it is run from a browser?

Subject: Web Agent Cache… how can this be avoided?

You should have your agent add a cache-control header to it’s output:

Print “Cache-Control: no-cache” ’ prior to your HTML/XML output.

Subject: RE: Web Agent Cache… how can this be avoided?

Thanks, Peter. Thank you more because “duh”. I do this all the time for other applications… the synapses aren’t firing this morning at all. The US really needs to introduce the concept of the siesta into the workday.

Subject: mmm…Siesta would be nice…