> Could you tell me why storing a recordset in an application 
> variable is not recommended. I saw this technique used 
> several times, and prefered over the cachedWithin method. 
> Apparently it's easier to control, to flush the cache, and I 
> guess you could use Cfqueryparam as well.

There is absolutely nothing wrong with caching recordsets in the
Application, Session or Server scopes as appropriate. Like any sort of
caching, you have to balance the pros and cons of the value of caching the
specific variable in question, that's all.

> But again, I'm quite confused with the two methods, as both 
> are loaded in the memory anyway..
> I guess if cachedWithin is here, it's probably for a good reason.

CACHEDWITHIN and CACHEDAFTER are there because they're very easy to use.
It's easier to just drop those attributes into a CFQUERY tag than it is to
write the logic needed to explicitly cache data in memory. The flip side of
this is that CACHEDWITHIN/CACHEDAFTER give you less control. My general
recommendation is that, if you're writing an application from scratch, you
use Application/Session/Server scopes. If you're modifying an existing
application, you should consider using CACHEDWITHIN/CACHEDAFTER.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260071
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to