Chapter 1: ColdFusion Tags
21
CACHEDIRECTORY
Optional. Specifies the fully qualified path of the directory where the pages are to
be cached. The default is the directory of the current page.
EXPIREURL
Optional. Used with ACTION=FLUSH. EXPIREURL takes a wildcarded URL
reference that ColdFusion matches against all mappings in the cfcache.map file.
The default is to flush all mappings. For example, "foo.cfm" matches "foo.cfm";
"foo.cfm?*" matches "foo.cfm?x=5" and "foo.cfm?x=9".
PORT
Optional. The port number of the web server from which the page is being
requested. The port number defaults to 80. The port number is useful because the
CFCACHE code calls CFHTTP. If the port number is specified correctly in the
internal call to CFHTTP, the URL of each retrieved document is resolved to
preserve links.
Usage
In its simplest form, all you need to do is code <CFCACHE> at the top of a page for it to
be cached.
With the ACTION attribute, you can specify server-side caching, browser caching, or a
combination of server-side and browser caching. The advantage of browser caching is
that it takes no ColdFusion resources because the browser stores the pages in its own
cache, thus, improving performance. The advantage of using a combination of the two
forms of caching is that it optimizes performance; if the browser cache times out, the
server can retrieve the cached data from its own cache.
In addition to the cached files themselves, CFCACHE uses a mapping file to control
caching. It is named cfcache.map and uses a format similar to a Windows INI file. The
mapping of a URL with parameters is stored as follows. Assume a directory
"c:\InetPub\wwwroot\dir1" that has a CFM file called "foo.cfm", which can be invoked
with or without URL parameters. The cfcache.map file entries for foo.cfm will look like
this:
[foo.cfm]
Mapping=C:\InetPub\wwwroot\dir1\CFCBD.tmp
SourceTimeStamp=08/31/1999 08:59:04 AM
[foo.cfm?x=5]
Mapping=C:\InetPub\wwwroot\dir1\CFCBE.tmp
SourceTimeStamp=08/31/1999 08:59:04 AM
[foo.cfm?x=9]
Mapping=C:\InetPub\wwwroot\dir1\CFCBF.tmp
SourceTimeStamp=08/31/1999 08:59:04 AM
The cfcache.map file in a given directory stores mappings for that directory only. Any
time the timestamp of the underlying page changes, ColdFusion updates the cache file
for that URL only. ColdFusion uses the SourceTimeStamp field to determine if the
currently cached file is up to date or needs to be rebuilt.
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...