> I'm not too sure how to handle caching. 
> So here is my question. Is it appropriate to store the 
> products recordset in an application variable within 
> onApplicationStart, and use QoQ for for data manipulation 
> in my different templates ? 

Any query that has significant reuse potential as-is, you should cache. If
you have to manipulate it with QoQ, the value of caching will decrease
significantly, as QoQ doesn't perform nearly as well as a direct database
query - your database has a very well-tuned query analyzer, and can take
advantage of indexes, etc.

> or is it better to use Cachedwithin or CachedAfter options 
> from CFquery ? 

Those options are easier to use, but give you less overall control. They
allow specific timeout values, so it's a little easier to keep the in-memory
data fresh. If you use Application/Session/Server, you have to write that
logic yourself. But, frankly, that's not very hard to do, and it lets you
easily handle freshening data when you want - when someone adds a new item,
for example. You can write logic to do that with CACHEDWITHIN/CACHEDAFTER,
but at that point you might as well just have used
Application/Session/Server. And, of course, not being able to use
CFQUERYPARAM in your CACHEDWITHIN/CACHEDAFTER queries is a big downside.

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:260073
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