Re: [SMARTY-DEV] Changed cache_lifetime-handling and added expiration date
| From: | Monte Ohrt | Date: | Fri, 12 Apr 2002 20:08:31 +0000 |
| Subject: | Re: [SMARTY-DEV] Changed cache_lifetime-handling and added expiration date | ||
| References: | 1 2 3 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-59@lists.php.net to get a copy of this message | ||
At the same time, I want to try to avoid adding any more user-configurable variables unless absolutely necessary. We probably just need to decide, for what reasons is each situation useful or makes better sense?
The question:
Should cached files each have their own expiration time, or should they just follow the "global" cache_lifetime value? Normally this wouldn't make any difference, since cache_lifetime doesn't change. If you are dynamically changing your cache_lifetime, then it will matter... does the cache file follow the lifetime that was originally in place when the cache was generated, or use the global one?
I could see some uses where you want to give different pages their own cache lifetime, they could be set when calling them. Example for a new feature:
$smarty->display('index.html', $cache_id, $my_cache_lifetime);
In this case, index.html will respect the value of $my_cache_lifetime and this value would be stored along with the template. If you don't supply the value, then $smarty->cache_lifetime is used by default.
Thoughts?
Monte
Norbert Röcher wrote:
"Monte Ohrt" <monte@ispi.net> schrieb im Newsbeitrag news:3CB72ECE.3000501@ispi.net...-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.Actually, does this affect intended behavior?I think so. In any case it adds a big piece of flexibility to the cache-handling.If I change the cache_lifetime, should I expect this to be respected on all existing cache files?Well, i didn't expect this and i wondered about this fact in smarty. I think a template-related expiring of the cache is more logic and usefull than one general lifetime for all files. Maybe an aditional switch (considerExpire/considerLifetime) could be the perfect solution!? Regards, Norbert