Preventing caching of plugins' output
| From: | Tommy Ipsen | Date: | Sat, 28 Aug 2004 22:22:13 +0000 |
| Subject: | Preventing caching of plugins' output | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-11732@lists.php.net to get a copy of this message | ||
Hi group
I'm having some problems with caching of plugin-output!
I've normally used the third parameter of register_function() to control cacheability of plugins but now I've rewritten the plugins and places them in the plugin directory where they are automatically loaded when necessary.
One of the plugins are used for providing localized dates and times for the templates - this is used for "todays date", "last modified", "this year" and so on - not all of these dates are allowed to be cached and I wonder if there is any way I can control it?
Examples of the use of my plugin:
{DateLocalized format="Y"}
{DateLocalized time=$page.timestamp}
{DateLocalized}
The function uses three optional parameters (format, time, lang) and I was wondering whether I should pass some kind of fourth parameter stating whether or not the result is cacheable? Or maybe the function call should be wrapped in some kind of "non-caching-tags"?
I hope you can help me out here - I've noticed quite a speed-up using caching and I would hate to "throw it away" because of this "detail".
Regards, Tommy Ipsen