Re: Using cache with session variables

From: Date: Fri, 22 Feb 2002 23:15:46 +0000
Subject: Re: Using cache with session variables
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2837@lists.php.net to get a copy of this message
What you need to do is cache only the parts that are SIMILAR for all users, regardless of their session IDs... for example, I have the "outer" design which has user preferences such as logged in status, their own quick links, etc., and that is main.tpl. main.tpl is never cached (and never directly hits the database - only if absolutely required, which is in the php scripts that require it). The content that doesn't change (say an article) get cached... that would be article.tpl which is included inside main.tpl's {$Content} variable (which is fetch()-> ed into it in the php script) - what you do is turn caching on when you call the fetch(), but turn it back off right before you display('main.tpl'). On pages where the {$Content} is never to be cached, just use $smarty->caching = false; on the tops of those pages. Brian 2/22/02 2:57:39 AM, pemphp <pemphp@free.fr> wrote: > > Hi, > > > Is it possible to use the cache with sessions.? > When sessions id is pass throw the url, how to use cache > when the session id change for each visitor.? > > > > > > Thanks > > > pemphp > mailto:pemphp@free.fr > > >--- >You are currently subscribed to smarty as: brian@massassi.net >To unsubscribe send a blank email to $subst('Email.Unsub') >Visit Smarty's homepage at >http://www.phpinsider.com/php/code/Smarty/ > > Brian

« previous php.smarty.general (#2837) next »