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?