Query Caching

The cf_spContentGet, and hence also the cf_spContent, tag includes a cachedWithin attribute, which works in the same way as the cachedWithin attribute of cfquery.

You can use this attribute to cache the query that results from a call to cf_spContentGet in memory. The value of the attribute must be a timespan created using the ColdFusion createTimeSpan() function.

This is particularly useful when paging through results as it avoids re-running the query (and any post-query processing in cf_spContentGet) for each page of results. You should always consider using the cachedWithin attribute with cf_spContent calls that use the displayPerPage attribute.

Note: the Speck query cache is independent of the ColdFusion query cache, so you do not need to enable query caching in the ColdFusion administrator. This also means there is no limit on the number of Speck query caches, so just be careful not to over do it!