I couldn't tell from Mark's question if he really was referring solely to the 
cache in
CF, since he moved on to "the materialized view option", which would of course 
not be
"in CF". But if, as Kai does, we read this to mean Mark is asking how to clear 
the
query cache in CF, there is indeed a way, and it doesn't involve any API call. 
Sadly,
it's one of the worst-named (and I think hardly-known) tags: 

CFOBJECTCACHE. Yep, that's what you use, as <cfobjectcache action="clear">. 
That's the
only attribute and value, and the tag has no other function but to clear the 
query
cache. So, yes, Mark, you could certainly set the cache to be cleared every 
hour by
doing that in a schedule task. 

But I'll share another thought: that will wipe out the entire query cache 
(yours, and
that of all other apps on the entire CF server/instance), which is pretty 
heavy-handed
(unless you're all on your own).

Perhaps instead what you want is that the cache not last per a time from the 
first
time it's cached (which is what the cachedwithin attribute on cfquery does) but
instead to cache "as of a given time", which is what the cachedafter attribute 
does.
Check that out (it's a little tricky to get just right), and see if that may 
not be
less of a hammer.

Hope that helps.

 

/charlie

 

From: cfaussie@googlegroups.com [mailto:cfaus...@googlegroups.com] On Behalf Of 
Kai
Koenig
Sent: Wednesday, May 19, 2010 2:07 AM
To: cfaussie@googlegroups.com
Subject: Re: [cfaussie] schedule a cached queries refresh

 

Just a random thought (with me _not_ having checked if a method exists) for a 
global
refresh - Admin API, runtime.cfc maybe? And then a scheduled task running 
against a
cfm page executing it?

 

Cheers

Kai

 





Here is a nice practical post about optimising code:

http://www.webapper.com/blog/index.php/2009/08/04/improve-coldfusion-performance-by-10
00x-believe-me-its-possible/

It made me wonder if there is a way to schedule a cached queries refresh. I 
mean have
it happen on the hour whether or not a page is visited.

I know there is the materialized view option but I dont know how to get an error
message when the view didnt recreate itself.

Is there a simpler way?

 

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaus...@googlegroups.com.
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.

Reply via email to