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
Try this:
In your application.cfm
cfif IsDefined(URL.refreshQueryCache)
cfset request.cachetimespan = CreateTimeSpan(0,0,0,0)
cfelse
cfset request.cachetimespan = CreateTimeSpan(1,0,0,0)
/cfif
Then...
cfquery name=query datasource=dsn
cachedwithin=#request.cachetimespan#
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
If I understand your question, I think the answer is, yes. Here's how I
handle this:
states_get.cfm (query template)
-
!--- DEFINE DEFAULT VALUE FOR TIME SPAN ---
cfparam name=request.cache_qStates default=#createTimeSpan(1,0,0,0)#
cfquery name=qStates
4 matches
Mail list logo