Cache and history are different things.
For cache, you can set headers (Google for ASP headers) or by giving a random GET parameter each time you link to the page.
For history, you need to use
location.replace somehow where it fits your algorithm.
[EDIT: this might not be what you actually looking for. I didn't read the problem carefully before answering this.]