Re: [PHP Template] cached templates...
[email protected] Wed, 01 Mar 2000 10:04:01 -0500
| Newsgroups | php.template |
|---|---|
| Message-ID | <[email protected]> |
Andrei Zmievski wrote: > I'll try to explain what I refer to as 'caching'. When the engine loads > a template file, it needs to parse through it and construct an > intermediate in-memory representation. When you later assign variables > and do tmpl_fetch(), it walks through this intermediate representation, > filling in values, looping sections, etc. and then returns the result. > So, unless template file changes on the drive, it's not necessary to > have the parsing stage done each time and thus this intermediate > representation can be cached in memory so that only the second stage is > necessary each time. I assume that the in-memory cached copy will only be available as long as the Apache (or other http server) child lives, x amount of requests (depending on the server config)? Is this correct, or am I way off? Is the template engine going to actually be a module to PHP, or a seperate cgi type program? > 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. I think that this type of caching would be a very good thing to have. It would help increse performance of multiple large db driven sites with data that really does not change very often. The question is... where would you store these 'staic' cached template outputs, the directory and file names would have to be accessible to the server process and take care to not clobber other 'static' cached templates. Aaron