>How do people cache queries when using cfqueryparam?

Store the query and creation time in the Application scope?

eg, something along the lines of...

<cfif NOT StructKeyExists(Application.CachedTime,'Whatever')
    OR DateDiff("h", Application.CachedTime.Whatever, Now()) GTE 4>

    <cfquery name="Whatever">
     ...
    </cfquery>
    <cfset Application.CachedQuery.Whatever = Whatever/>
    <cfset Application.CachedTime.Whatever  = Now()/>
<cfelse>
    <cfset Whatever = Application.CachedQuery.Whatever/>
</cfif>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270089
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to