If your code is using modules/namespaces (and or explicitly creating
them) then by all means cache things in the namespace. I knew I should
have mentioned that but ... :)

I've sped things up by doing so - just make sure that your code can deal
with the fact that the namespace may or may not contain cached values
and that you properly expire/update the cache when appropriate. Code
that was written for once-offs may need to be slightly rewritten to take
persistence into account.

-- 
Andrew O'Brien


> -----Original Message-----
> From: Chris Allen [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, 4 September 2003 10:38 AM
> To: [EMAIL PROTECTED]
> Subject: Re: sharing data across SSI's (Executes)
> 
> 
> On Wed, Sep 03, 2003 at 09:41:02AM +1000, Andrew O'Brien wrote:
> > 
> > 
> > Need 2: A request-specific global variable: store in $req. 
> eg $req->{key} = $value
> > 
> 
> Is it reasonable to define a global by giving it its own 
> package? - eg:
> 
> $mywebsite::cache={};
> 
> $mywebsite::cache->{product_1}=$product_object;
> 
> 
> Under mod_perl, this [apparently] creates a global variable that
> lasts for the lifetime of the apache child - ideal for fast
> caching of unchanging database objects.
> 
> ..or am I looking for trouble and should be using 
> $req->{something}...???
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to