This happens to be one of the very few instances I would condone the use of
application variables...

1. When the application is first started set an application like this:
        <cfparam name="application.cacheTime"
default="#CreateTimeSpan(0,0,60,0)#"> (or whatever you want)

2. use this application variable in the cachedwithin attribute of every
query you want to control
3. don't touch the application variable again unless you type a keyword in
the url string.  Put an IF statement in application.cfm to look for a url
variable like this:
        <cfif isdefined("url.setCache")>
                <cfset application.cacheTime =
createTimeSpan(0,0,url.setCache,0)>
        </cfif>
                                                    
this way you can simply type "setCache=0" in the url then run the pages you
want the cache cleared on then type "setCache=60" in the url string again
and be done with it :)


Bryan Love ACP
Internet Application Developer
[EMAIL PROTECTED]
                                                    


-----Original Message-----
From: Duane Boudreau [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 14, 2001 9:00 AM
To: CF-Talk
Subject: Flushing Query Cache


I am looking for a way to flush query cache.

I tried:

<cfif IsDefined("flushcache")>
<cfquery name="qry" cachedwithin=CreateTimeSpan(0,0,0,1)>
</cfif>

<cfquery name="qry" cachedwithin=CreateTimeSpan(1,0,0,0)>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to