Ask a Question related to Coldfusion Database Access, Design and Development.
-
Brian Hogue #1
enable query caching?
I want to cache a QoQ.
I added cachedwithin="#CreateTimeSpan(0, 0, 5, 0)#" to the CFquery tag. This
should cache for 5 minutes .. which should be good enough for my test. I
test for the cache with
<cfoutput>#IsDefined("qoqRequirementDateDueX.Cache d")#</cfoutput>.
This value is NO. So I reread the CF 7 Reference Manual. It says that query
caching must be enabled in the Administrator. I cannot find any help on
that. Your guidance is appreciated.
-brian
Brian Hogue Guest
-
web svc caching
We are about to deploy our newly developed web svc, but since our svr is a laptop with limited resource and limited bandwidth, I guess I'll use a... -
query caching
hi if i do <cfcache action="cache"> and have a query on this page, is it cached? or do i need to do <cfquery cachedwithin> ? thanks k -
[PHP-DEV] --enable-versioning does not work (was: [PHP-DEV] [PATCH] disallow --enable-versioning with shared modules)
Hello Jani, Friday, November 14, 2003, 5:15:39 PM, you wrote: -
FM caching
Hi All, On Windows, does anyone know how to manipulate where FM caches? Our Windows network is setup to only allow a 30mg roaming profile... -
ASP Caching
Hello, I have a simple web form page in which I insert/update data to a database. The SQL code to insert data is written in a server side submit... -
SafariTECH #2
Re: enable query caching?
If a query is cached, it is cached - to my knowledge you can't test for it
What you will see is a performance difference when you have a ton of data.
i.e. on our 50,000 item DB, the first query takes abput 20-30 seconds. If we
have it cached for a period of time, subsequent page loads by ANYONE will see
that list in 2-3 seconds. If we remove the cache setting, it will take 20-30
sec for each page request
It returns NO because you actually haven't setup a variable by that name so it
does not exist.
As fo the ADMIN, yes you have to tell it to allow cached queries by setting
the maximum number of cached queries under the caching section.
SafariTECH Guest
-
Brian Hogue #3
Re: enable query caching?
SafariTECH -
Thanks for the reply. On your second point, the documentation suggests that
caching a query automatically sets up this variable and makes it value YES.
On the last point, then the default value (100) enables query caching.
Let's try this a different way. Can I cache a QoQ? If yes, is there special
syntax? Or can I use the developer's guide as a model? The guide only
demonstrates CFquery against a DB, not QoQ.
-brian
"SafariTECH" <contact@safaritech.com> wrote in message
news:df5n5f$t3t$1@forums.macromedia.com...data.> If a query is cached, it is cached - to my knowledge you can't test for it
>
> What you will see is a performance difference when you have a ton ofwe> i.e. on our 50,000 item DB, the first query takes abput 20-30 seconds. Ifsee> have it cached for a period of time, subsequent page loads by ANYONE will20-30> that list in 2-3 seconds. If we remove the cache setting, it will takeso it> sec for each page request
>
> It returns NO because you actually haven't setup a variable by that namesetting> does not exist.
>
> As fo the ADMIN, yes you have to tell it to allow cached queries by> the maximum number of cached queries under the caching section.
>
Brian Hogue Guest
-
mxstu #4
Re: enable query caching?
Brian Hogue,
I've only skimmed your post but:
1) To test whether the query is cached, use the "result" attribute of cfquery
and then output #yourResultName.cached#.
<cfquery result="yourResultName" ....> .... </cfquery>
<cfoutput><b>is cached?: </b>#yourResultName.cached#</cfoutput>
2) Administrator setting: Maximum number of cached queries:
I would think that specifying a number greater than zero would enable query
caching. Or in other words, cached queries are not allowed if the maximum
number is zero
3) I don't know that it's a great idea in every situation, but yes you can
cache a QoQ.
<cfquery name="getEmps" datasource="#myDSN#" result="myResult">
SELECT FirstName, LastName, City
FROM employees
ORDER BY LastName, FirstName
</cfquery>
<!-- cache QofQ --->
<cfquery name="getLocalEmployees" dbtype="query"
cachedWithin="#CreateTimeSpan(0,0,5,0)#" result="myResult">
SELECT FirstName, LastName, City
FROM getEmps
WHERE City = 'Seattle'
ORDER BY LastName, FirstName
</cfquery>
<cfoutput><b>cached: </b>#myResult.cached#<br></cfoutput>
mxstu Guest
-
mxstu #5
Re: enable query caching?
** EDIT: NG users do not see modifications **
Brian Hogue,
I see I should have read your post more thoroughly ;-) Afaik, "result"
produces one time variables that are only available *after* you run the
cfquery, which doesn't sound like what you are looking for. As SafariTech
mentioned, I don't think that there is a way to test for the existence of a
cached query.
mxstu Guest



Reply With Quote

