Re: Storing additional stuff in the cache
| From: | Andrei Zmievski | Date: | Wed, 20 Mar 2002 14:53:52 +0000 |
| Subject: | Re: Storing additional stuff in the cache | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3124@lists.php.net to get a copy of this message | ||
On Wed, 20 Mar 2002, Ivo Jansch wrote:
> Hi,
>
> I have a site with a lot of queries. I use caching to prevent the
> queries from happening on each pageload.
>
> But there is some information (one field from one of the queries) that I
> always need to know. So I always have to perform this query. Is it
> someway possible to put this value in the cache, along with the cached
> page? So if the page comes from the cache, and no queries are performed,
> I still have my variable value?
There is no API to do this, but it should be possible. Smarty has an
array called $_cache_info that stores several variables. You could add
your variable to that array and it will be available after
display()/fetch() call. You just have to be careful not to overwrite the
variables that Smarty needs.
-Andrei
* Only 19,999 lines of C++ to my next ski trip... *