Re: [SMARTY-DEV] Re: Smarter caching needed
| From: | messju mohr | Date: | Mon, 30 Jun 2003 14:22:03 +0000 |
| Subject: | Re: [SMARTY-DEV] Re: Smarter caching needed | ||
| References: | 1 2 3 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1708@lists.php.net to get a copy of this message | ||
On Mon, Jun 30, 2003 at 02:32:28PM +0400, Konstantin A. Pelepelin wrote:
[...]
> To developers: I have another question about caching.
>
> I have a page with long list of search results. Each element of list
> changes very rare, but the whole page is the result of user's request, so
> the set of elements changes every time and there is small chance to have
> cache hit.
> Or a page consists of parts with different mean update time.
> I'd like to cache individual elements, and do it with custom function,
> something like
>
> {cacheable_include file="..." cache_group="elements_$id"
> cache_lifetime=68400 [parameters...]}
>
> The question is: can I use $smarty object passed to
> smarty_function_cacheable_include() for $smarty->fetch() in that function,
> or my modified caching parameters will interfere with old parameters and I
> should create new Smarty object for each include (or save/restore some
> internal vars)?
yes, fetch inside a plugin-function should work as expected. even with
different compile_ids or cache_ids.
that's my experience, but i'm not 100% sure if this is an officially
supported feature so you can rely on in the future.
> Konstantin A. Pelepelin