Thanks Jeff,

I'm not certain (off the top of my head) if query caching was really
included in the onTap framework. The method I usually use is to create
a structure to hold dates for caching in the application scope. Any
time a given query is run, it uses cfparam to ensure a date value for
that query with the current time as a default for the cachedafter
attribute. Any time data in the relevant tables is updated, I simply
set the value of the application variable to now() and this forces the
application to return to the database for the next query.

If you're concerned about preserving RAM, this isn't going to expire
the queries quickly, since it will wait for the application to expire
before all queries are refreshed. My opinion about memory usage for
data caching as a general rule is this: it's less expensive than
more/faster processors. I have yet to have any legitimate problems
caused by the amount of available RAM on a server -- although oddly
enough I did once run into a problem with one client who didn't have
enough physical storage (hd space) on a server. ;P Iirc that was
caused largely by the frequency and longevity of their database
backups -- creating them too often and keeping them too long.

Because most of the queries in my CMS application are from stored
procedures, cachedwithin isn't available for those, so I've created
similar caching routines for storing structures and other types of
data. There's a content.cfm custom tag in the framework that stores
strings of html output in the application scope and uses cachedwithin
and cachedafter as attributes by using datediff() to compare now()
with the timestamp for the given bit of content.

Lately lurking is probably fairly appropriate unfortunately. I've been
pretty busy trying to wrap up a client project and starting a new
project that have been taking up much of my time. I lost the
transmission in my car, and to add insult to injury, my apartment
complex poisoned me. They laquered or painted something in the
apartment next door and it's been ventilating into my unit, directly
over my desk. I've been prone to ear infections in the past, so when I
started getting dizzy I didn't think much of it. I breathed it in for
a little over a day before I passed out and we realized what was
happening. I'm staying at a friend's place right now and working from
here, but it's like pulling teeth trying to get any kind of recompense
from the complex for the fact that they've injured me both physically
and financially. All they want to do is wave their hands in the air
and say "it's fine now".

s. isaac dealey                972-490-6624

team macromedia volunteer      http://www.macromedia.com/go/team

chief architect, tapestry cms  http://products.turnkey.to

onTap is open source           http://www.turnkey.to/ontap

> Oops, I am pretty sure this works in CF5 but I can't
> remember if I used
> it back then or not. This definitely works in MX. Also,
> the
> "cachewithin" attribute is pretty much a must unless you
> have a query
> you want to keep indefinitely (be nice to your RAM memory,
> it is your
> friend). Another point, this will clear all queries in the
> cache so it
> may be overkill. The previous suggestion about setting the
> cachewithin
> attribute to '0' is a surefire way to kill the cache on
> just a single
> query. S. Isaac (who is lurking on this list daily) has
> some pretty neat
> ways to cache queries within his framework, onTap.

> Good luck,
> -JSLucido

> -----Original Message-----
> From: Jeff Lucido [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 10, 2003 8:20 AM
> To: CF-Talk
> Subject: RE: How do I flush cached queries?

> <cfobjectcache action="">
> Good luck,
> -JSLucido

> -----Original Message-----
> From: Pete Ruckelshaus [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 10, 2003 8:03 AM
> To: CF-Talk
> Subject: How do I flush cached queries?

> I have tried using the undocumented <cfset
> CFUSION_DBCONNECTIONS_FLUSH()>  but it is not flushing
> query results and
> forcing a new query (I want to flush the cached queryies
> whenever an
> administrator updates info in the database).  Is there any
> other way to
> flush cached query results?  I am using CF5 on Win2K with
> MS SQL Server
> 2000.

> Thanks

> Pete

>   _____

>   _____

>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to