RE: Caching custom tag article somewhere?

2003-07-28 Thread Rich Z
Thanks much. Very cool. How've you found the performance with this?
(then again it is your CHILD, heheh)

-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED] 
Sent: Sunday, July 27, 2003 11:11 PM
To: CF-Talk
Subject: RE: Caching custom tag article somewhere?

That would be an article I wrote. The tag was called scopeCache and was
pretty simple. This is the MX version. The nonMX version would need
loads of locks. This shold be extended to support things like timeouts,
etc.

cfif not isDefined(attributes.name) or not
isSimpleValue(attributes.name)
cfthrow message=scopeCache: The name attribute must be passed
as a string.
/cfif
cfif not isDefined(attributes.scope) or not
isSimpleValue(attributes.scope) or not
listFindNoCase(application,session,server,attributes.scope)
cfthrow message=scopeCache: The scope attribute must be passed
as one of: application, session, or server.
/cfif

!--- create pointer to scope ---
cfset ptr = structGet(attributes.scope)
!--- init cache root ---
cfif not structKeyExists(ptr,scopeCache)
cfset ptr[scopeCache] = structNew()
/cfif

cfif isDefined(attributes.clear) and
structKeyExists(ptr.scopeCache,attributes.name)
cfset structDelete(ptr.scopeCache,attributes.name)
cfexit
/cfif

cfif thisTag.executionMode is start
!--- determine if we have the info in cache already ---
cfif structKeyExists(ptr.scopeCache,attributes.name)
cfoutput#ptr.scopeCache[attributes.name]#/cfoutput
cfexit
/cfif
cfelse
cfset ptr.scopeCache[attributes.name] =
thistag.generatedcontent
/cfif


===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email: [EMAIL PROTECTED]
Blog : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

My ally is the Force, and a powerful ally it is. - Yoda 

 -Original Message-
 From: Rich Z [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, July 27, 2003 6:36 PM
 To: CF-Talk
 Subject: Caching custom tag article somewhere?
 
 
 Guys:
  
 I could have SWORN I'd read an article that explained a 
 custom tag (very simple one actually) that gave the user the 
 option of defining which scope to cache the content, etc. 
 Real neat little tag. I THINK the article was in CFDJ, but I 
 can't find it in the archives. 
  
 Can someone help?
  
 Rich
 
 

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
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.
http://www.cfhosting.com

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



RE: Caching custom tag article somewhere?

2003-07-28 Thread Raymond Camden
Have I found the performance? Do you mean have I done performance
testing? Nothing formal. 


===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email: [EMAIL PROTECTED]
Blog : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

My ally is the Force, and a powerful ally it is. - Yoda 

 -Original Message-
 From: Rich Z [mailto:[EMAIL PROTECTED] 
 Sent: Monday, July 28, 2003 7:12 AM
 To: CF-Talk
 Subject: RE: Caching custom tag article somewhere?
 
 
 Thanks much. Very cool. How've you found the performance with 
 this? (then again it is your CHILD, heheh)
 

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=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



RE: Caching custom tag article somewhere?

2003-07-27 Thread Raymond Camden
That would be an article I wrote. The tag was called scopeCache and was
pretty simple. This is the MX version. The nonMX version would need
loads of locks. This shold be extended to support things like timeouts,
etc.

cfif not isDefined(attributes.name) or not
isSimpleValue(attributes.name)
cfthrow message=scopeCache: The name attribute must be passed
as a string.
/cfif
cfif not isDefined(attributes.scope) or not
isSimpleValue(attributes.scope) or not
listFindNoCase(application,session,server,attributes.scope)
cfthrow message=scopeCache: The scope attribute must be passed
as one of: application, session, or server.
/cfif

!--- create pointer to scope ---
cfset ptr = structGet(attributes.scope)
!--- init cache root ---
cfif not structKeyExists(ptr,scopeCache)
cfset ptr[scopeCache] = structNew()
/cfif

cfif isDefined(attributes.clear) and
structKeyExists(ptr.scopeCache,attributes.name)
cfset structDelete(ptr.scopeCache,attributes.name)
cfexit
/cfif

cfif thisTag.executionMode is start
!--- determine if we have the info in cache already ---
cfif structKeyExists(ptr.scopeCache,attributes.name)
cfoutput#ptr.scopeCache[attributes.name]#/cfoutput
cfexit
/cfif
cfelse
cfset ptr.scopeCache[attributes.name] =
thistag.generatedcontent
/cfif


===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email: [EMAIL PROTECTED]
Blog : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

My ally is the Force, and a powerful ally it is. - Yoda 

 -Original Message-
 From: Rich Z [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, July 27, 2003 6:36 PM
 To: CF-Talk
 Subject: Caching custom tag article somewhere?
 
 
 Guys:
  
 I could have SWORN I'd read an article that explained a 
 custom tag (very simple one actually) that gave the user the 
 option of defining which scope to cache the content, etc. 
 Real neat little tag. I THINK the article was in CFDJ, but I 
 can't find it in the archives. 
  
 Can someone help?
  
 Rich
 
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

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