You know you can force the browser to bring back a new page by making the URL unique. So, you want to jump to the most foolproof method around: changing the URL so that browsers and caches won't find a match and will have to cough up fresh data.
However, it's not enough to create a unique URL on the server. As you know, making the link unique by using code on the Web server has a basic limitation: the back button. No matter what you do on the server, if the browser doesn't get a fresh copy of the page that has the link, you won't get a new link.
<cfoutput> <a href="newpage.cfm?Nr=#rand()#"> Server Link</a><br> <a href="newpage.cfm/Nr/#rand()#"> Server Extra Path</a> </cfoutput>
And then create newpage.cfm and have it display a unique identifier using ColdFusion's createUUID function to show that you aren't getting the same page over and over:
<cfset Unique=createUUID()> <cfoutput> #Unique# </cfoutput>
Browse almost.cfm and click the link to reach newpage.cfm. Look carefully at the URL. Now press the back button and do it again. When you do it again, you'll see that the link doesn't change! If circumstances were bad, you would see the identifier repeat on newpage.cfm as a result. (Fortunately, most of the time, circumstances aren't that bad.)
Go back. This time, refresh almost.cfm, and the link will change. This approach to unique links is OK if the user can't go back. Otherwise, a fundamentally different approach is needed.
Create and browse unique.cfm. Notice that the link doesn't have a true location any more. Instead, the desired location is a parameter to a function that appends the milliseconds since a fixed date in the past and then tells the browser to go to the resulting URL.
<head>
<script language="javascript">
function goto(Link) {
now=new Date();
var Nr=now.getTime();
Link=Link+Nr;
document.location=Link;
return true;
}
</script>
</head>
<a href="javascript:goto('newpage.cfm?Nr=')">
Javascript Query String</a><br>
<a href="javascript:goto('newpage.cfm/Nr/')">
Javascript Extra Path</a>