Re: [PHP Template] cached templates...
[email protected] ("J. M. Castagnetto") Wed, 01 Mar 2000 16:49:25 PST
| Newsgroups | php.template |
|---|---|
| Message-ID | <[email protected]> |
>From: Andrei Zmievski <[email protected]> >To: [email protected] >CC: PHP Template Engine <[email protected]> >Subject: Re: [PHP Template] cached templates... >Date: Wed, 1 Mar 2000 08:43:10 -0600 > >On Wed, 01 Mar 2000, [email protected] wrote: [...snip...] > > I am wondering if it will be possible to cache sections (not sure if > > this makes sense), or would this be done best by using the > > {{include some_template}} > > command? I'm thinking that if each page on a site has a navagation bar > > that is generated from some db info but it only changes once a day then > > will that need to be in its own template file in order to be cached? I > > assume so. > >I see that you want to actually cache the template output for some time. >I suppose we can allow for that, it'd have to be a separate setting that >says how long to cache the template output for. Since we'd have two >kinds of caching, I'm not sure what would be good names for each one >then. Couldn't this be easily done programatically at the PHP script level? I think that the caching of the compiled version of the template is useful, but why have a caching of the template output in the PHP Template Engine side? I am using a (very simple) set of templates for a new version of the MDB site, and have some simple caching logic. The first time the page is loaded, it goes through all the parts, parsing them, and saving the parsed output to files (if they are tagged as static). Next time the page is loaded (or a page that uses similar parts, e.g. a navigation bar), it checks if a part is cached and if it is is just adds it to the output, then sends the whole thing back. If the page itself is tagged as static, then it saves itself in toto to a cache dir. With simple logic I can decide how long to cache the page or each part, just look at a control file that has a creation timestamp and a number of days to be cached and decide whether to send the cached page or create it anew. I may be wrong, but the output caching should not be done at the PHP Template Engine level, it should be done at the PHP host script level or a the PHP parser level or something like that. Keeping the number of similar named options in a config file is "a good thing" (TM) > >-Andrei >* "UNIX, isn't that some archaic form of DOS?" - our job applicant * > ===== Jesus M. Castagnetto - [email protected] PalmPilot stuff & etc.: http://www.geocities.com/jm_castagnetto/ LAB: http://www.scripps.edu/research/metallo Metalloprotein DB: http://metallo.scripps.edu/ ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com