> I am definately open to suggestions.

> Actually a silly question - being not all that familiar
> with the details
> of caching - Since that query is dynamic - how does the
> cache work?
> dynamic piece-
> ....AND #ProviderPage# = 1 AND iApplication =
> #ApplicationPage#
> It seems that if the query was set to
> ....AND Rehab = 1 AND iApplication = 2
> it would cache for say 20 minutes with code like (
> cachedwithin="#createTimeSpan(0,0,20,0)#" )

> Now - someone comes by in 10 minutes and the dynamic query
> is reset to ....AND Rehab = 2 AND iApplication = 3

> It would mean that those values are not queried nor stored
> in cache - and database has to requery the db? How does that
> work? In this case does cache become useless or cache
> stores the different possibilities and uses them as needed?

Now that you mention it, that's probably your issue right there. What
happens is the app only uses the cache as long as those 2 variable names
stay the same, so it's probably not using the cache most of the time since a
given user would be moving around the site and changing those page variables
-- it would only use the cache when they hit refresh.

You could include the variables in the name of the query and that would
maintain the cacheing, but it also requires some gymnastics to then access
the query and it increases the number of cached queries maybe more than you
want to since the entire CF server has a default maximum of 100 of them.

You could also create your own cacheing using the application scope, which
isn't terribly difficult although you might find it somewhat tedious.

Or you could do something like this:

<cfquery name="rsapplicationpages"
cachedafter="#request.contentcachedafter#">
        SELECT ....
        FROM ModuleFeatures mf, applicationmodules am
        WHERE mf.imodule = am.iapplicationmoduleID
        ORDER BY iApplication, iModule, sFeatureSubHeading
</cfquery>

This will cache a large query containing the whole db, then you can requery
this data from the cache like so:

<cfquery name="GetModuleFeatures">
        SELECT * FROM rsapplicationpages
        WHERE #ProviderPage# = 1
        AND iApplication = #ApplicationPage#
        ORDER BY iApplication, iModule,
                sFeatureSubHeading
</cfquery>

I'm not sure I've ever tried using a variable in a query of query in the
context of #providerpage# here where it's a column name instead of a value,
so I won't guarantee it'll work, but it's something to try. :)

I'd be interrested to know what your final solution is and how it works out
for you. I haven't done anything serious in Access in several years, so I
can't say that I'm terribly familiar with handling load in that environment
and it's always good to keep abreast. :)

hth


s. isaac dealey                954-776-0046

new epoch                      http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource     http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816


> I appreciate the assistance!
> jay

> Matt Robertson wrote:


> But if this is pre-cfmx then you have to readonly cflock
> the query ,
> since

> it contains an app var, right? :(



> For the sake of argument, does the length of the caching
> mean so much?
> I

> mean, if you set it to 10 minutes wouldn't even that
> pretty much take a

> mountain of weight off the db? 1 hour would seem, on the
> surface and
> with

> admittedly little detailed info, to be more than plenty to
> assure a

> well-rested db.



> --Matt Robertson--

> MSB Designs, Inc.

> http://mysecretbase.com <http://mysecretbase.com>



> ----- Original Message -----

> From: "S. Isaac Dealey"   <mailto:[EMAIL PROTECTED]>
> <[EMAIL PROTECTED]>

> To: "CF-Talk"   <mailto:[EMAIL PROTECTED]>
> <[EMAIL PROTECTED]>

> Sent: Thursday, February 06, 2003 4:47 PM

> Subject: Re: Really Long Cache Period- advisable?







> I'd recommend using CachedAfter instead of CachedWithin...



> <cflock scope="application" type="exclusive" timeout="30">

> <cfparam name="application.contentcachedafter"
> default="#now()#">

> <cfset request.contentcachedafter =
> application.contentcachedafter>

> </cflock>



> <cfquery name="rscontent"
> cachedafter="#application.contentcachedafter#">

> SELECT ...

> </cfquery>



> When you update the content, simply update the cachedafter
> variable



> <cfquery > UPDATE ...</cfquery>

> <cflock scope="application" type="exclusive" timeout="30">

> <cfset application.contentcachedafter = now()>

> </cflock>



> Assuming the application never times out, the query will
> remain cached

> indefinitely, so a day, 7 days, 30 days, etc.





> s. isaac dealey                954-776-0046



> new epoch                       http://www.turnkey.to
> <http://www.turnkey.to>



> lead architect, tapestry cms    http://products.turnkey.to
> <http://products.turnkey.to>



> tapestry api is opensource      http://www.turnkey.to/tapi
> <http://www.turnkey.to/tapi>



> certified advanced coldfusion 5 developer

> http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
> <http://www.macromedia.com/v1/handlers/index.cfm?ID=21816>





> Hello list - I have a question about caching results from

> a SQL query.

> Short question : I want to set a query cache for like 7

> days.

> very bad? or not a big deal?



> Longer Question / Explanation:



> I used a quick access database to setup content for a

> site. I output 1

> main grouped queries - which is dynamically set by page

> names on 12

> different pages - The code just switches a simple key in

> the WHERE

> statement.



> I planned on using CFCOntent to create static pages BUT to

> ease

> development and content - I built in a set of admin

> functions to add and

> remove information and quickly reorganize it. Client loved

> it so much

> they want to have the ability to use that all the time.

> Problem is I

> don't want to maintain different pages.

> I considered adding a long cache (like 7 days) to limit

> the amount of

> times the query is run.......And on the admin page -

> having a button

> that can immediately refresh that cache.



> Adivisable or not? Is it best for me simply to do it the

> right way and

>  have admin section changes publish everytime through

>  cfcontent?- I am

> just nervouse because the pages are complex and use alot

> of flash,

> javascript and css code.



> I hope I am clear - Any advice is much needed and greatful

> Jay







> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> ~~~~~~~~~~~|

> Archives:

> http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
> <http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
> >

> Subscription:  http://www.houseoffusion.com/cf_lists/index
> <http://www.houseoffusion.com/cf_lists/index> .

> cfm?method=subscribe&forumid=4

> FAQ:  http://www.thenetprofits.co.uk/coldfusion/faq
> <http://www.thenetprofits.co.uk/coldfusion/faq>

> This list and all House of Fusion resources hosted by

> CFHosting.com. The place for dependable ColdFusion

> Hosting.



> Unsubscribe:  http://www.houseoffusion.com/cf_lists/uns
> <http://www.houseoffusion.com/cf_lists/uns>

> ubscribe.cfm?user=633.558.4










> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~|
> 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
> Structure your ColdFusion code with Fusebox. Get the
> official book at http://www.fusionauthority.com/bkinfo.cfm

>                               Unsubscribe: http://www.houseoffusion.com/cf_lists/uns
>                               ubscribe.cfm?user=633.558.4


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

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

Reply via email to