Re: [SMARTY] Cache cleanup
| From: | Monte Ohrt | Date: | Fri, 14 Jun 2002 16:32:51 +0000 |
| Subject: | Re: [SMARTY] Cache cleanup | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4858@lists.php.net to get a copy of this message | ||
I should have seen this coming :-) OK, but when the file check _does_ happen, it will cause noticable lag time... unless we can make the script release it's connection to the browser and then perform the cleanup and exit. I don't know if that is possible (?)
* Should both cache and compile files be periodically cleaned?
* Should this be part of the engine, or an optional plugin?
Monte
Gary Loescher wrote:
What about setting up a cache cleanup probability variable (ala PHP gc_probability for sessions) that determines when Smarty will clear the cache upon instantiation? Gary -----Original Message----- From: Monte Ohrt [mailto:monte@ispi.net] Sent: Friday, June 14, 2002 11:06 AM To: Peter Bowyer Cc: Ivo Jansch; smarty-general@lists.php.net Subject: Re: [SMARTY] Cache cleanup Cleaning cache files would be a considerable overhead. For _every_ cache file (recursively) it has to open file, extract timestamp, test against the current time and unlink if necessary. It would definately add a lot of execution time to the engine. It would be much more efficient to do this via cron: find /path/to/cache -atime +2 -exec rm -f {} \; This doesn't interefere with Smarty execution time either. Windows users would need a different method, maybe a php script to periodically run? Peter Bowyer wrote:-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.At 10:47 14/06/02 -0500, Monte Ohrt wrote:It won't happen automatically. You must do it yourself periodically, either with clear_cache or directly.Shouldn't Smarty take care of cleaning out old files? Peter -- Maple Design - quality web design and programming http://www.mapledesign.co.uk