User Guide
cfcache 61
You can specify client-side caching or a combination of client-side and server-side caching (the
default), using the action attribute. The advantage of client-side caching is that it requires no
ColdFusion resources; the browser stores pages in its own cache, improving performance. The
advantage of combination caching is that it optimizes server performance; if the browser does not
have a cache of the page, the server can get data from its own cache. (Macromedia recommends
that you do not use server-side only caching. Macromedia recommends that you use combination
caching.)
If a page contains personalized content, use the
action = "clientcache" option to avoid the
possibility of caching a personalized copy of a page for other users.
Debug settings have no effect on
cfcache unless the application page enables debugging. When
generating a cached file,
cfcache uses cfsetting showDebugOutput = "No".
The cfcache tag evaluates each unique URL, including URL parameters, as a distinct page, for
caching purposes. For example, the output of http://server/view.cfm?id=1 and the output of
http://server/view.cfm?id=2 are cached separately.
The
cfcache tag uses the cfhttp tag to get the contents of a page to cache. If there is an HTTP
error accessing the page, the contents are not cached. If a ColdFusion error occurs, the error is
cached.
Example
<!--- This example produces as many cached files as there are
URL parameter permutations. --->
<cfcache
timespan="#createTimeSpan(0,0,10,0)#">
<body>
<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>