you can have separate file caches based on user privileges. 
try this..

<cfset stParams=structNew()>

<cfif user.groupName = "Admin">

<!--- Admin User --->

<cfset stParams.userType="Admin">

<cfa_contentObject 
   objectID="#objID#"
   method="displayTitle"
   stParams="#stParams#"
   bUseCache="Yes"
   cacheType="File"
   cacheDir="#cacheDir#/adminUser">
<cfelse>
<!--- Edit User --->

<cfset stParams.userType="Edit">

<cfa_contentObject 
   objectID="#objID#"
   method="displayTitle"
   stParams="#stParams#"
   bUseCache="Yes"
   cacheType="File"
   cacheDir="#cacheDir#/editUser">
</cfif>

this will create a cache based on the user privileges the first time it is
run. 

An even better solution will be to use <cfa_generatedContentCache> and
append the user user group into the cache Name so that you get separate
caches based on user groups.



Vinod


-----Original Message-----
From: Chris Tweney
To: Spectra-Talk
Sent: 2/8/01 4:30 PM
Subject: Caching & run-time attributes

Hey all,

I have a poorly-performing Spectra 1.01 application that needs some
judicious use of caching to help it along.
We do not use containers or pages or anything like that. A page is made
up
of up to several hundred distinct
content objects, each with their displaycontent method called. I'd like
to
use the FILE cacheType in conjunction
with my cfa_contentobject calls. I want to avoid using the SESSION
cacheType
since it will only give improvements
on a per-session basis (and even then the first view of any given object
is
slow). 

The problem is this: We need to present certain things depending on
runtime
variables: e.g. if the user is logged in
and is an admin, then print the "Edit" button. How can I do this in
Spectra
1.01 and still keep my handy (and fast) file-based
caching in place? 

Any ideas are appreciated.

Chris Tweney 
Media Application Developer
roundpeg 
www.roundpeg.com 
1700 California Suite 260 
San Francisco, CA. 94109 
Ph. 415-437-3900 x 140
Fax 415-437-3904
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to