php缓存,PHP缓存详谈

大家会问什么是SMARTY缓存:

< ?php require('./smarty/Smarty.class.php'); $smarty = new Smarty; Z) $smarty->caching = true; if(!$smarty->is_cached('index.tpl')) // No cache available, do variable assignments here. ) $contents = get_database_contents(); $smarty->assign($contents); } $smarty->display('index.tpl'); ) ?>



这个首先判断是否有这个缓存文件!没有直接链接数据库!有的话!执行DISPLAY。就是读取缓存。大家看到上面的2个例子!对缓存有很大的理解了吧!

Tags:  php静态缓存 php页面缓存 php禁止缓存 php不缓存 php缓存技术 php缓存

延伸阅读

最新评论

发表评论