Delorey Consulting Home Page
Helping you outshine the competition
Expiring Page - Preventing Form reloads from cache

The following links are provided as-is without warranty of any kind to visitors to act as a resource for ColdFusion development. They are NOT meant to be a full-fledged tutorial on an subject, but rather a brief overview of specific scenarios involving a typical problem and a ColdFusion solution.

Problem

You have developed a form, but want the page to reload (and not used a cached copy) when the user revisits the page.

Code

<cfheader name="Expires" value="#GetHttpTimeString(Now())#">


Notes

Forces reload by setting the current time as the expiration time. When researching this, materials indicated this was not a 100% sure-fire fix for related issues, but it did solve the particular problem it was researched for.

Picking a static date in the past also worked, i.e. <cfheader name="expires" value="Thu, 1 Jan 1970 01:00:00 GMT">

Back to Code Snippets
 

Related Links

Live-Docs: CFHEADER
Macromedia documentation

Caching Tutorial
Includes a section on Pragma HTTP Headers and why they don’t work