Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Does Smarty Support clear_cache("index.tpl", "

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
ShenKong
Smarty Rookie


Joined: 20 Jan 2004
Posts: 27

PostPosted: Mon Apr 05, 2004 8:42 am    Post subject: Does Smarty Support clear_cache("index.tpl", " Reply with quote

I don't know if Cache Groups can do it .

I will clear the cache files "common.tpl" which cache_id like "374fd7341b54a7e750efec84e31bfd15soft" or "9e018e398d4a58ff7f8a5c41fd64a3bbarticle" .
mmh , the cache_ids make up of 32chars(unknow) and category name :
in fact the cache id is :
Code:
$cache_id = md5($class_name . $class_id . $id . mt_rand()) . $class_name.$level;

so I can know only the $class_name . $level, I want to clear cache files which cache id is * . $class_name . $level ., also my cache id may be $class_name . $level . *

Can I use Cache Groups to carry it out ?
clear_cache("common.tpl", $class_name . $level);
or :
clear_cache("common.tpl", $class_name . $level1 | $class_name . $level2);

How does " clear all caches with "sports" as the first cache_id group." mean ??

Thanks ... I use this in clear pagination cache . There are many classes , and children classes .... I distinguish them from $class_name and $level .
_________________
Something comes soon ...
http://www.showtop.net
http://www.openphp.cn
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Apr 05, 2004 6:52 pm    Post subject: Reply with quote

cache groups work from left to right, separating groups with vertical bars. the docs explain pretty clearly how they work. I don't understand your use of cache ids with that md5 string in there.
Back to top
View user's profile Send private message Visit poster's website
ShenKong
Smarty Rookie


Joined: 20 Jan 2004
Posts: 27

PostPosted: Tue Apr 06, 2004 1:33 am    Post subject: Reply with quote

Do you mean "clear_cache("common.tpl", "id1 | id2");" will clear the cache files that cache id like "id1id2xxxxx" and "clear_cache("common.tpl", "id1");" will clear the cache files that cache id like "id1id2xxxxx" or "id1xxxxxxx" ?
_________________
Something comes soon ...
http://www.showtop.net
http://www.openphp.cn
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue Apr 06, 2004 1:51 am    Post subject: Reply with quote

Rather, you define your cache_id something like:

Code:
$cache_id = "$template_name|$class_name|$class_id|$id";


In order of precedence, $class_name, $class_id and $id are all cache groups. In which case,

Code:
clear_cache($template_name, $template_name);


is what I think you may be after.
Back to top
View user's profile Send private message
ShenKong
Smarty Rookie


Joined: 20 Jan 2004
Posts: 27

PostPosted: Tue Apr 06, 2004 2:26 am    Post subject: Reply with quote

Oh~ I must rebuild my cache system .... god

Thanks ... everyone .
_________________
Something comes soon ...
http://www.showtop.net
http://www.openphp.cn
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue Apr 06, 2004 3:11 am    Post subject: Reply with quote

not rebuild (I would think) -- just change the way you are refering to your cache keys

test first--make sure it does what you think it needs to before going all the way Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP