|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ShenKong Smarty Rookie
Joined: 20 Jan 2004 Posts: 27
|
Posted: Mon Apr 05, 2004 8:42 am Post subject: Does Smarty Support clear_cache("index.tpl", " |
|
|
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Apr 05, 2004 6:52 pm Post subject: |
|
|
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 |
|
ShenKong Smarty Rookie
Joined: 20 Jan 2004 Posts: 27
|
Posted: Tue Apr 06, 2004 1:33 am Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue Apr 06, 2004 1:51 am Post subject: |
|
|
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 |
|
ShenKong Smarty Rookie
Joined: 20 Jan 2004 Posts: 27
|
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue Apr 06, 2004 3:11 am Post subject: |
|
|
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 |
|
Back to top |
|
|
|
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
|