Name

CFCACHE

Synopsis

<CFCACHE>

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). To cache a ColdFusion template, just add the CFCACHE tag to the top of the page.

When the 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 (written as cfcache.map) contains the mapping to the temp file, as well as a timestamp that determines when to expire the cached file. When using the CFCACHE tag, there are a few additional points that should be considered:

  • Templates that generate errors don’t get cached.

  • 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 using the CFSETTING tag.

  • Simultaneous Requests in the ColdFusion Administrator must be set to a minimum of 2 for the CFCACHE tag to work.

Attributes

ACTION="cache|clientcache|flush|optimal

The action to be performed by the CFCACHE tag. Optional. The default is Cache, which caches the page. ClientCache caches the page in the client’s browser, Flush refreshes the cached page, and Optimal caches the page using both server-side and browser caching.

PROTOCOL=" protocol_name "

The protocol to use when creating the pages from the cache. Options ...

Get Programming ColdFusion now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.