Contents > Developing ColdFusion MX Applications > Designing and Optimizing a ColdFusion Application > Optimizing ColdFusion applications > Caching ColdFusion pages that change infrequently Using the cfcache tag PreviousNext

Using the cfcache tag

You tell ColdFusion to cache the page results by putting a cfcache tag on your ColdFusion page above code that outputs text. The tag lets you specify the following information:

You can also specify several attributes for accessing a cached page on the web server, including a user name and password (if required by the web server), the port, and the protocol (HTTP or HTTPS) to use to access the page.

Place the cfcache tag above any code on your page that generates output, typically at the top of the page body. For example, the following tag tells ColdFusion to cache the page on both the client and the server. On the server, the page is cached in the e:/temp/page_cache directory. ColdFusion retains the cached page for one day.

<cfcache timespan="#CreateTimespan(1, 0, 0, 0)#" directory="e:/temp/page_cache">

Caution: If your Application.cfm page displays text; for example, if it includes a header page, use the cfcache tag on the Application.cfm page in addition to the pages that you cache. Otherwise, ColdFusion displays the Application.cfm page output twice on each cached page.


Contents > Developing ColdFusion MX Applications > Designing and Optimizing a ColdFusion Application > Optimizing ColdFusion applications > Caching ColdFusion pages that change infrequently Using the cfcache tag PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.