Not sure situation is the same, but I use cachedafterdate for my cached
queries. If I've changed data, say on an update page, I include the query
template and add a variable "update = 1" or like that.
In application.cfm, I've set a cachedafterdate variable as today's date
(without any time) (or it could be in the query template)
In the query template, I do:
<cfif IsDefined("Update")>
    set the cachedafterdate to an advanced date (one day beyond the
cachedafterdate variable)
</cfif>

Then in the query, I reference  cachedafter="#cachedafterdate#". If regular,
it will use the regular cachedafterdate; if called by an update template,
will do a new one.

Works fine and updates any cached queries immediately after updating data.
Hope this gives some ideas. Probably could be modified for the cachedwithin
attribute.

E. Keith Dodd
Wings of Eagles Services
www.wingserv.com
----- Original Message ----- 
From: "Jim Banks" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, June 05, 2003 8:19 AM
Subject: CFQUERY - cachedwithin


> When you have used cachedwithin in CFQUERY, is it possible to override
that before the cachedtime is up? For example,
>
> <cfif not isdefined("application.recache")>
>     <cfquery name="query" datasource="dsn"
cachedwithin="#createtimespan(0,1,0,0)#">
>     ...BLAH...
>     </cfquery>
> <cfelse>
>     <cfquery name="query" datasource="dsn">
>     ...BLAH...
>     </cfquery>
>     <cfset temp = structdelete(application, "recache")>
> </cfif>
>
> Here, it'd be great if I could 'reset' the query so that if I've defined
somewhere else on the site that the query has changed using the application
variable, I can get it to use the new query results and cache that for next
time, instead.
>
> Thanks!
>




-
[This E-mail scanned for viruses by declude AntiVirus Software]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to