My understanding is that cfcache is pretty rudimentary actually... the
cache isn't stored until the page finishes loading, then once it's
loaded subsequent request use the cache, so if you have 2 simultaneous
(or overlapping) requests for the same cache, then they'll both build
the page and the latter one will overwrite the cache created by the
first.
There are alternative methods of caching... Usually the most granular
approach will produce the least amount of duplicated effort on the
part of the server. There's a tag called cf_supercache for caching
segments of code that generate display. The syntax looks like this:
<cf_supercache name="name_of_my_cache">
<cfif x>blah blah</cfif>
blah blah
</cf_supercache>
Content which reaches the output buffer within the tags is included in
the cache - subsequent requests then use the cache instead of
executing the contents of the tag. The onTap framework has a built-in
equivalent of this as well.
There are also methods of caching data rather than display... At my
day job we've just implemented a CFC structure with a factory for
handling price information (real-estate). So when you need price info,
you call application.siteFactory.getPriceManager(unitid) to get the
object for your respective unit from memory. Inernally each
priceManager object then also holds a number of dollar values in
memory which are generated using stored procedures. The SP's are fast
sure, but the cache is always much faster. And this solution is much
more granular (and flexible) than the cf_supercache type tag solution,
though it requires a lot more planning and may not be an appropriate
solution in all cases. My Blogs onTap sample application uses some of
both types of caching.
s. isaac dealey 954.522.6080
new epoch : isn't it time for a change?
add features without fixtures with
the onTap open source framework
http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:218515
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54