Re: [SMARTY] Cache groups problem

From: Date: Tue, 11 Mar 2003 17:55:36 +0000
Subject: Re: [SMARTY] Cache groups problem
References: 1 2 3  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-8563@lists.php.net to get a copy of this message
Katana wrote:
I have something like: $tpl->display('main.php', 'group1|group2|group3'); and i attempt to clear the cache using: $tpl->clear_cache(null, 'group1|group2') but the compile_id (the language, fr, here) is appended to the cache_id (auto_id). My cache files are in a directory like <cache_dir>/group1/group2/group3/fr/ And the directory smarty attempts to delete is <cache_dir>/group1/group2/fr/
ok. now it's getting a little bit confusing. there are several things to mention, these things have been discussed ~ 1/2 year ago: i assume, you're using the class var compile_id, IMO not a good idea, because, thats the only case, the compile id is automatically chosen by clear_cache (but usually you do not want to use the compile_id, since every different compiled version has to be cleared) Compile IDs are used to store different *representations* of the same data, so the different compiled versions of a template have to be stored under the same caching directory. if you clear a cache because of changed data, you also have to clear _all_ different representations of that data (the different cached compiled versions). So the compile_id has to be appended to the cache_id. in case of using the class var, there is still a problem (as you saw yourself), but the changes (compile_id before cache_id) would break the main functionality of cache grouping for different compiled versions. Andreas -- andreas kossmeier bergfex.at - http://www.bergfex.at

« previous php.smarty.general (#8563) next »