You could have an Application variable that would flag your page whether or
not updates to the database had been made. If changes were made, you could
set the cachedwithin to zero.
EXAMPLE:
<cfset cacheTime = CreateTimeSpan(1,0,0,0)>
<cfif Application.DataHasBeenUpdated EQ 1>
<cfset cacheTime = 0>
</cfif>
<cfquery name="someQuery"
datasource="someDSN"
cachedwithin="#cacheTime#">
SELECT COLUMN1, COLUMN2
FROM TABLE
WHERE CONDITION = SOMETHING
</cfquery>
Hope this helps!
--
SCOTT VAN VLIET
SENIOR ANALYST
SBC SERVICES, INC
Tel: 858.886.3878
Fax: 858.653.6763
Email: [EMAIL PROTECTED]
-----Original Message-----
From: Smith, Daron [PA] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 9:09 AM
To: CF-Talk
Subject: Forcing Query Refresh (Sometimes)
I want to cache a query for 99% of the time. However, when users update the
data, I want to allow them an option to refresh the query and set that query
as the newly cached one. I can't use the cachedwithin attribute, or at
least not as I know of it, but I really could benefit from caching, just
when the data is updated I need to reset the cache.
I know I could stop and start the CF service, but only I have access to this
option and it's not optimal.
Thanks for any help,
Daron J. Smith
Web Developer
PSEA
[EMAIL PROTECTED]
717-255-7141
1-800-944-PSEA (7732) x 7141
Please note new email address (old one with 'mail' will soon expire)
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists