>It is my understanding of/experience with query caching that results are 
>cached based on the name of the query, and not the actual "guts" of the 
>query, so having multiple users each with their own dynamic queries but all 
>run under the same query name will mean that only the first cached query 
>gets run (at least that's what it looks like in my testing) -- is that the 
>case?  If so, what is the best way to "store" these results so that going 
>to the next page doesn't mean the query needs to get run again?  Should I 
>do something like append the CFTOKEN for that user's session to the query 
>name so that it is unique?  Or should I store the query output as an array 
>in a session variable?
>
>All I want is for the user to not have to wait for subsequent pages after 
>the first page is loaded...

According to the CF docs (and having used it myself), for CF to use the 
cached query results, "the current query must use the same SQL statement, 
datasource, query name, username and password." This is regardless of 
whether or not you use cachedwithin or cachedafter to cache your query.

Therefore, if you pass in two different filters to the database, it will be 
looked at as two different queries, with two different sets of cached 
results.

One thing to note is that, for obvious reasons, if you want to cache a 
query, you cannot use <cfqueryparam> for the values you pass in to the 
query.

Regards,
Dave.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to