We've got a dedicated machine with quite a bit of Ram - so its not an
issue, and at the moment we have about 20-30 sites running of about 10
code bases.

So for each of those sites they have their own app name and app
variables, hence the first line in my code checking the URL.

I suppose my question more is - is it better to keep using the
app.scope when i can just get the information from the cached query.
I'm also thinking in shared hosting enviroments as well?

Andy J







The information doesnt change much at all 
On 9/14/05, Andy McShane <[EMAIL PROTECTED]> wrote:
> Personally, if your information is unlikely to change on any regular basis
> then I would use the application scope. As for having too much in the
> app.scope I suppose it really depends on the machine and how much memory you
> have to play with. If what you have below is all that have in the app scope
> then there should be no problem at all.
> 
> -----Original Message-----
> From: Andy Jarrett [mailto:[EMAIL PROTECTED]
> Sent: 14 September 2005 10:08
> To: CF-Talk
> Subject: When to use Application var?
> 
> I have a bit of code on a smallish, low hit site
> 
> 
> <cfset thisSiteName = ListGetAt(cgi.script_name, 1, "/")/>
> 
> <cfif NOT application.init OR structKeyExists(url, "reinit")>
>         <cfquery datasource="#variables.dsn#" name="thisCompany">
>                 SELECT *
>                 FROM companydetails c
>                 WHERE c.company_folder = '#thisSiteName#'
>         </cfquery>
>         <cfset application.companyName = thisCompany.company_name />
>         <cfset application.companyWebsite = thisCompany.company_website />
>         <cfset application.companyEmail = thisCompany.company_email />
>         <cfset application.companyId = thisCompany.company_uid />
>         <cfset application.companyfolder = thisCompany.company_folder />
>         <cfset application.company_prerefix = thisCompany.company_prefix />
> 
>         <cfset application.init = 1>
> </cfif>
> 
> It just sets up some basic site wide vars - nothing special. What im
> thinking though is that this is just a bad use of the application
> scope? Surely i could just use
> 
> <cfquery datasource="#variables.dsn#" name="thisCompany"
>  cachedWithin="#createTimeSpan(2,0,0,0)#">
>         SELECT *
>         FROM companydetails c
>         WHERE c.company_folder = '#thisSiteName#'
> </cfquery>
> <cfset request.companyName = thisCompany.company_name />
> <cfset request.companyWebsite = thisCompany.company_website />
> <cfset request.companyEmail = thisCompany.company_email />
> <cfset request.companyId = thisCompany.company_uid />
> <cfset request.companyfolder = thisCompany.company_folder />
> <cfset request.company_prerefix = thisCompany.company_prefix />
> 
> Which would save the having too much in the app.scope?
> 
> Am i missing something obvious? What would/does everyone else do?
> 
> Andy J
> www.andyjarrett.co.uk
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:218170
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to