Bill,

Depending on what the query is doing you can use the query as and app query and only 
one user will hit it within the time period.  If the query is user specific it won't 
help any.

Hope this helps.  It will allow one db hit for all users in 10 minutes.  Passing 
refresh=1 in the URL will reload the app before the 10 min is up.

<cfscript>
        if (isdefined('url.refresh'))                                   // param that 
allows manual refresh of queries
                timespan =  createtimespan(0,0,0,0);            // clear cache
        else            
                timespan =  createtimespan(0,0,10,0);           // ten minute cache
</cfscript>

<cfquery name="application.getEvents" datasource="#application.dsn#" maxrows="4" 
cachedwithin="#timespan#">
        SELECT      *
        FROM         Calendar 
        WHERE           Expire_date > #application.eventdate#
        ORDER BY        Date_Start,event_title
</cfquery>

-rice

-------- original ---------
If I cache a query, does that mean that on the server that same query gets
cached for every user that hits the site, or is it cached once when the
first user hits.  Which is better, to cache it or not.

Bill Killillay
ICQ @ 8425781
-----------------------------------------------
FREE! The World's Best Email Address @email.com
Reserve your name now at http://www.email.com


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to