Kevin,

You can cache queries two diffent ways.

1) you know this already - use the parameters in the
CFQUERY tag to cache your queries

2) store them in session or application scope.  That's
when you use flags to refresh:

<cfif NOT isDefined("session.getProducts") OR
IsDefined("attributes.newquery")>

<cfquery name="session.getProducts" datasource="#attributes.dsn#">
select foo from bar where whatever
</cfquery>

</cfif>

1 & 2 are both appropriate methods of caching queries.  1
is newer, but is not the best technique for all occasions.

-Erik


> -----Original Message-----
> From: Kevin Bridges [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 04, 2001 7:41 AM
> To: Fusebox
> Subject: Query Caching
>
>
> What is the best way to cache queries in the following
> scenario?  I have a
> search screen that posts to a frameset in which there are 4
> frames that all
> use different parts of the query.  Behaviors are defined that let a
> scrolling action in one frame control scrolling in other
> frames so the data
> has to synch ... meaning the same query must be used for all 4 frames.
> Because it is a search interface multiple users may be
> entering different
> criteria for the search in rapid succession.
>
> From my understanding if I just cache the query for a set
> time period it
> becomes cached for all users ... So I was thinking of adding
> the cftoken to
> the end of the query name and setting the time period really
> low ... but if
> I set time period to low and user is on a slow connection I
> run the risk of
> not having the query available to all 4 frames because they
> won't load in
> time.  If I set the time period to high then the user will not get new
> information if the search returns no results and they decide
> to conduct
> another search or they simply conduct a new search.
>
> I read a suggestion of checking for an attributes flag to
> refresh the query
> .... but the only way to refresh a cached query (please
> correct me if wrong)
> is to generate a completely new query of same name with no
> cachedwithin
> information ... If I do that then the 4 frames break because
> query is not
> persistent.
>
> Any suggestions or ideas?
>
> Thanks,
>
> Kevin Bridges
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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