面试啦 - 提供专业面试问题及答案、面试技巧、助您成功面试!
您的当前位置:首页 > 面试题库 > IT面试题 > PHP面试题 > 正文

如何配置、使用和清除Smarty缓存

1、Smarty缓存的配置
$smarty->cache_dir = “/caches/”; //缓存目录
$smarty->caching = true; //开启缓存,为flase的时侯缓存无效
$smarty->cache_lifetime = 60; //缓存时间
2、Smarty缓存的使用和清除
$smarty->display(‘cache.tpl’, cache_id); //创建带ID的缓存
$smarty->clear_all_cache(); //清除所有缓存
$smarty->clear_cache(‘index.htm’); //清除index.tpl的缓存
$smarty->clear_cache(‘index.htm’,cache_id); //清除指定id的缓存
词条:php面试题
上一篇:PHP面试题-$message和$$message的区别 下一篇:比较基础的php面试题及答案-编程题
与该文相关的文章

温馨提示:如果您对面试网有任何建议,请通过网站联系邮箱向我们反馈,感谢各位的建议与支持!