Caches a ColdFusion page for faster
access by writing a temporary static HTML version of the page to disk
(either server-side or in the client’s browser
cache, or both). To cache a ColdFusion template, just add the
cfcache tag to the top of the page.
cfcache tag caches a page, two files are
actually written to the server. First, a temporary file (with a
.tmp extension) is created that contains the
HTML necessary to generate the static version of the page. A mapping
file contains the mapping to the temp file, as well as a timestamp
that determines when to expire the cached file. The name for the
mapping file is determined by appending the hash of the current URL
Hash( ) in Appendix B) to
cfcache_. This results in filenames like this:
When using the
cfcache tag, there are a few
additional points that should be considered:
Templates that generate errors don’t get cached.
Pages generating personalized content should be cached on the client
action="ClientCache") to avoid serving the
cached content to people who are not intended to see it.
By default, the
cfcache tag suppresses all
debugging information for a ColdFusion template. To use debugging
within a cached page, you must explicitly turn it on for the template
Simultaneous Requests in the ColdFusion Administrator must be set to
a minimum of 2 for the
cfcache tag to work.
In ColdFusion MX, it’s now possible to ...