Prevent Internet Explorer (IE) and other browser caching in ColdFusion

Just a quick note - as I keep forgeting this.

With its standard setting Internet Explorer will fetch the same URL from its cache if called a second time within the same browser session. That is if the URL had no special Headers set.

To prevent IE and other browsers from caching a URL simply add this to your Coldfusion files:

<cfheader name="cache-control" value="no-cache, no-store, must-revalidate"> 
<cfheader name="expires" value="-1"> 
<cfheader name="pragma" value="no-cache"> 
share