CFCACHECONTENT
Used to store a specific amount of content to cache, improving page rendering performance and server memory costs. Use this function when its not necessary to serve dynamic content with every page request. Cache duration can be specified to be any lenth of time using the CACHEDWITHIN attribute. Additionally, cache can be manually flushed by setting the ACTION attribute to 'flush' and the CACHENAME attribute to the name of the cached resource that you wish to flush.
Usage
<cfcachecontent> ... </cfcachecontent>
Attributes
Attribute | default | required | summary |
---|---|---|---|
NAME | YES | The name of the cache | |
CACHEDWITHIN | The timespan (CreateTimeSpan) for the life of the content in the cache | ||
REGION | default cache | The type of cache to use; this can be any of the registered cache handlers |
Extra
<!--- Cache the results of myObj.myIntensiveFunction() for 1 hour ---> <cfcachecontent name="mypagecache" cachedwithin="#CreateTimeSpan( 0, 1, 0, 0 )#" > <cfoutput>#myObj.myIntensiveFunction()#</cfoutput> </cfcachecontent>