Shouldn't CachedAfter really be called CachedBefore?
You are telling it to cache the query UNTIL a specified date/time, right?
At 05:27 PM 1/12/01 +0000, Philip Arnold - ASP wrote:
>> I have three different queries on page that the only difference among
>> them is what the results are ordered by. I suppose that I can cache the
>> query the so when the user selects how they want the list sorted, the
>> process time will be decreased. My question is I need help because I
>> have never done it before. Any guidance would be appreciated.
>
>OK, there's 2 basic ways you can cache a query - for a time period
>(CachedWithin) and until a certain date/time (CachedAfter)
>
>All you have to do is put a real date/time variable in the specific fields;
>CachedWithin uses a TimeSpan (a period of time)
>CachedAfter uses a DateTime variable (a specific date/time)
><cfquery name="myQuery" datasource="myDSN"
>cachedwithin="#CreateTimeSpan(0,1,0,0)#"> will cache for one hour, then
>re-cache
><cfquery name="myQuery" datasource="myDSN"
>cachedafter="#CreateDateTime(2001,1,20,12,0,0)#"> will cache until midday on
>the 20th Jan 2001
>
>You can obviously put generated variables in their place, but that's it
>
>As long as the query is exactly the same, the datasourse is the same, query
>name the same, and the cache period is exactly the same, then it'll load
>from the cache - if it's not cached yet or the period has passed, then it
>re-loads and re-caches
>
>HTH
>
>Philip Arnold
>Director
>Certified ColdFusion Developer
>ASP Multimedia Limited
>T: +44 (0)20 8680 1133
>
>"Websites for the real world"
>
>**********************************************************************
>This email and any files transmitted with it are confidential and
>intended solely for the use of the individual or entity to whom they
>are addressed. If you have received this email in error please notify
>the system manager.
>**********************************************************************
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists