Yeah, a URL parameter! (Why didn't I think of that?)
I've already got my cache spans in variables (e.g. request.cacheSpan), so
this is a piece of cake.
mydomain.com/myPage.cfm?clearCache=1
_______ application.cfm _________
// snip
if (isdefined("url.clearCache")) {
request.cache_span = createtimespan(0,0,0,0);
}
// snip
So I can refresh the whole site, if need be, or piecemeal, as you explained.
Thanks, everyone, for the good solutions.
Jamie
On Fri, 01 Jun 2001 13:50:11 -0400, in cf-talk you wrote:
>Jamie,
>
>You could set a variable for the cachetime in Application.cfm or on the
page
>itself use that in query. Then use a flag variable passed along URL to
>indicate whether cached query needs to be cleared. If flag exists, then
>change cachetime to zero.
>
>Here's an example.
>
><-- set in app.cfm -->
><cfset Variables.cachetimelimit=CreateTimeSpan(0,0,30,0)>
>
><-- page with query>
><cfif IsDefined("URL.modcache")>
> <cfset Variables.cachetimelimit=CreateTimeSpan(0,0,0,0)>
></cfif>
>
><cfquery datasource="#MetaDataSource#" name="MetaTable"
>cachedwithin="#Variables.cachetimelimit#">
></cfquery>
>
>Chris
>------------------------------------------------------------------
>Chris Lomvardias
>[EMAIL PROTECTED]
>Syscom, Inc.
>400 E. Pratt Street, Suite 300
>Baltimore, MD 21202
>(410)539-3737 x1722 voice
>(410)539-7302 fax
>[EMAIL PROTECTED] (pager via email)
>http://www.syscom.com/
>------------------------------------------------------------------
>
>
>-----Original Message-----
>From: Jamie Jackson [mailto:[EMAIL PROTECTED]]
>Sent: Friday, June 01, 2001 12:03 PM
>To: CF-Talk
>Subject: Best way to clear Cached Queries?
>
>
>What's the best way to clear out a cached query, so that your
>production site will use the most current database information? I want
>to retain my long cache spans on a production box, but I want to be
>able to "update" or "refresh" the queries at will.
>
>Here is my current process:
>1. Break the connection (give the datasource a faulty path/name) in
>the administrator.
>2. Hit the template in a browser.
>3. Repair the broken connection in the CF administrator.
>4. Hit the page again. The query is updated/re-cached.
>
>I don't like this method, because it is awkward, and it momentarily
>affects the production site. Is there a better way?
>
>Thanks,
>Jamie
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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