At 13:24 07/09/2003 +0100, you wrote:
>I've just developed a site where I have a lot of request variables defined
>in application.cfm, which are constant values...
>
>Would there be benefit in defining these as application variables?

If you're using CFMX, probably best to store constants in the Application 
scope. Unless there are "race condition" risks (i.e. risk of two processes 
updating a value at once), which is very unlikely with constants, you don't 
need to lock the scope when you access the vars. Then you've got them all 
stored once for the whole application, whereas putting them in the Request 
scope stores them in memory once for every current request.

Pre-MX, my rules-of-thumb are:

- Store frequently accessed constants and variables in the Request scope 
for ease of access
- Store anything only accessed once or twice during any request in the 
Application scope, and remember to lock when reading
- The larger and less frequently accessed the data, the better candidate it 
is for storing in Application, and vice versa for Request

HTH,

Gyrus
[EMAIL PROTECTED]
play: http://norlonto.net/
work: http://tengai.co.uk/
PGP key available 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

Reply via email to