coldfusion - Using cachedwithin attibute inside cfquery -


How do you store this query in memory when you use the cachedwithin attribute in cfquery? Archives that you submitted to the query? For example, if I cache a query for one hour on my index page and get it name, people use a query (or same page for that matter) with a single name on the same page as the cache result Will or will it use some better logic to decide whether this is the only question?

In addition, if your query contains a variable, then what value is the value of the variable in the cache?

This is not just a name - this is the exact query you are running.

  & lt; Cfquery name = "getPeople" Cachedwithin = "5" ... ... select name from employee command by name & lt; / Cfquery & gt;  

If you call this same query somewhere in your app, then you will get a cached version if it is within half-day of the first query but for the latest data, Will be killed:

   

And yes, it takes a variable account. If you use cfqueryparam - what you should do - your database will cache the query plan , but even cachedwithin By using, each query will be treated as a changed parameter separate from the query caching perspective. Note that this means that if you use cachedwithin on a query that runs multiple times with different criteria, you will inhibit your query cache with questions with low query hit rates.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -