> -----Original Message-----
> From: Al Musella, DPM [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 04, 2001 2:42 PM
> To: CF-Talk
> Subject: How to uncache a querry?
> 
> 
> 
>    I make extensive use of cached queries on 1 of my websites, that uses 
> read-only data that gets updated once a week..
> 
> the problem is that when I update that database, I want to clear 
> the cache 
> so the new data is used.. sometimes the cached querry presents a record 
> that is no longer available, and when you click to get the details - the 
> record is no longer there, so it generates an error.
> 
> So - how do you clear the cache? Hopefully with cfcode without having to 
> restart the CF server?
> 

In your cfquery tag, set cachedwithin="#CreateTimeSpan(0,0,0,0)#".

This will flush the query from memory and reload the data from the database.  You will 
have to set a variable for the timespan since the query wouldn't be cached any more if 
you made it expire right away!  So you will need to set a timespan of 0 so the query 
runs with this on the first hit after the database is updated.  There are many ways to 
do this but it will depend on your database management interface and how it is 
integrated with your app.  You could re-run the said query with a timespan of 0 right 
after you update the db .  In this way you wouldn't have to touch the other cfm pages 
that use the original timespan.

- Andy



> 
> 
> 
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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