本页主题: Smarty的 templates_c 和 cache 有何作用和区别? 打印 | 加为IE收藏 | 收藏主题 | 上一主题 | 下一主题

phpma

该用户目前在线
级别: 管理员
精华: 6
发帖: 263
威望: 275 点
金钱: 2750 RMB
贡献值: 0 点
注册时间:2007-05-17
最后登录:2008-08-28

Smarty的 templates_c 和 cache 有何作用和区别?

require_once ("smarty/class/Smarty.class.php");
$tpl = new Smarty();
$tpl->template_dir = "templates/";
$tpl->compile_dir = "smarty/templates_c/";
$tpl->config_dir = "smarty/configs/";
$tpl->cache_dir = "smarty/cache/";
$tpl->left_delimiter="<!---{";
$tpl->right_delimiter="}--->";
$tpl->caching = true;
我是这样设置的
可是cache文件夹中什么都没有,永远都是空的,删除了也没有关系 。
请达人给介绍一下

答;
smarty实例教程说过,cache是缓存,设定smarty的cache属性为true时,在设定的时间期内将用户的WEB请求直接转换到这个静态的HTML文件中来,这相当于调用一个静态的HTML文件。templates_c是编译目录

我的问题是用ajax+smarty写了一个分页,可是不知道为什么,添加了新的数据,分页不能读取新的数据
好像分页显示的数据是从缓存来的,可是我找不到缓存数据的地方,$tpl->caching = false; 数据好像还是被缓存

template_c里缓存了模板,可是cache里什么都没有

达人给个正解
顶端 Posted: 2007-08-23 17:03 | [楼 主]
开源嘛论坛 » php技术讨论

Guest cache page, Update at 2008-08-28 18:34 桂ICP备07006725号
Powered by PHPWind v6.0 Certificate Code © 2003-07 PHPWind.com Corporation