RE: [SMARTY] caching example
| From: | Monte Ohrt | Date: | Mon, 31 Mar 2003 17:54:27 +0000 |
| Subject: | RE: [SMARTY] caching example | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9013@lists.php.net to get a copy of this message | ||
If you use the session ID as the cache ID, you are essentially creating
a separate set of cache files for every page, every visitor. What are
you gaining by using caching in this case? It seem that it would be an
unnecessary (and big!) overhead. You might be better off leaving caching
off for session-based personalized content. If the pages have a lot of
content that is identical for every user, cache that only and leave the
personalized parts uncached.
Monte
On Mon, 2003-03-31 at 10:13, Andrew S. Nagy wrote:
> I am building a large scale CMS with smarty and am following this practice
> of breaking up the templates and including them; however, we are also using
> a cache_id for each cache and the cache_id is set to the session id. So
> each logged in user has it's own cache for their session, just don't forget
> to call the clear cache in the gc function!
>
> Has anyone else done anything like this? How does it work for you?
>
> Andrew
>
> > -----Original Message-----
> > From: Wom.bat [mailto:wom.bat@gmx.net]
> > Sent: Saturday, March 29, 2003 9:59 PM
> > To: Paul Lockaby; smarty-general@lists.php.net
> > Subject: Re: [SMARTY] caching example
> >
> >
> > > I have a site that has logins with usernames and ids and stuff like
> > > that. It shows the username on each page. I want to cache stuff, but I
> > > don't want to cache the usernames. What is the easiest way to display a
> > > username or other user specific information while still caching the rest
> > > of the document? I'm aware that I can use insert, but perhaps there is
> > > some other trick that I'm not aware of...
> >
> > insert is _very_ slow, you better split your template into several smaller
> > ones, so that you can cache parts of the page. I'd recommend an index.tpl
> > file which includes login.inc.php, content.inc.php etc via include_php
> >
> > Regards,
> > David
> >
> >
> >
> > --
> > Smarty General Mailing List (http://smarty.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
--
Monte Ohrt <monte@ispi.net>