Macromedia coldfusion 4.5-cfml language reference User Manual

Page of 608
22
CFML Language Reference 
You can refresh the cache in the following ways:
TIMEOUT attribute — ColdFusion tests the timestamp of the cached file 
against the TIMEOUT attribute. If the cached file’s timestamp is older than 
TIMEOUT, the old file is deleted and a new one created. You can use fixed dates 
if necessary, but it's preferable to use relative dates. This is the preferred 
technique and it works for seconds, hours, days, weeks, years, etc.
ACTION=FLUSH — You use ACTION=FLUSH to force the clean up of cached 
files. It can take two attributes, DIRECTORY and EXPIREURL.
Manually — Manually or programmatically (using CFFILE) delete the .tmp files. 
This is not recommended.
Note the following regarding CFCACHE:
CFCACHE requires that ColdFusion Server "simultaneous requests" be greater 
than 1. When a cache file is generated, the requested page requires two 
connections to satisfy the request. When a cached file is found, only one 
request is required.
Debug settings have no effect on CFCACHE unless the template explicitly turns 
it on. When generating a cached file, CFCACHE uses 
<CFSETTING 
SHOWDEBUGOUTPUT="NO">
.
ColdFusion does not cache pages that are dependent on anything other than 
URL parameters.
To use CFCACHE with the Secure Sockets Layer (SSL), specify 
PROTOCOL="http://"
. If you need to use SSL, you must run ColdFusion as a 
desktop application. Please note, however, Allaire strongly recommends that 
you run the ColdFusion Server as a service. For more details about using SSL, 
see Knowledge Base article #1096 at 
http://www.allaire.com/Support/
KnowledgeBase/SearchForm.cfm
.
If a template returns an error for any reason, the error page gets cached.
Example
<!--- This example will produce as many cached files as there
are possible URL parameter permutations. --->
<CFCACHE TIMEOUT="#DateAdd("h", "-4", Now() )#">
<HTML>
<HEAD>
<TITLE>CFCACHE Example</TITLE> 
</HEAD>
<BODY>
<H1>CFCACHE Example</H1>
<H3>This is a test of some simple output</H3>
<CFPARAM NAME="URL.x" DEFAULT="no URL parm passed" >
<CFOUTPUT>The value of URL.x = # URL.x #</CFOUTPUT>
</BODY>
</HTML>